Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Nz::ParticleDeclaration Class Reference

Graphics class that represents the declaration of the particle, works like an ECS. More...

Inheritance diagram for Nz::ParticleDeclaration:
Nz::RefCounted

Public Member Functions

 ParticleDeclaration ()
 Constructs a ParticleDeclaration object by default.
 
 ParticleDeclaration (const ParticleDeclaration &declaration)
 Constructs a ParticleDeclaration object by assignation. More...
 
 ~ParticleDeclaration ()
 Destructs the object and calls OnParticleDeclarationRelease. More...
 
void DisableComponent (ParticleComponent component)
 Disables a component. More...
 
void EnableComponent (ParticleComponent component, ComponentType type, std::size_t offset)
 Enables a component. More...
 
void GetComponent (ParticleComponent component, bool *enabled, ComponentType *type, std::size_t *offset) const
 Gets a component. More...
 
std::size_t GetStride () const
 Gets the stride of the declaration. More...
 
void SetStride (unsigned int stride)
 Sets the stride of the declaration. More...
 
ParticleDeclarationoperator= (const ParticleDeclaration &declaration)
 Sets the current particle declaration with the content of the other one. More...
 
 NazaraSignal (OnParticleDeclarationRelease, const ParticleDeclaration *)
 
- Public Member Functions inherited from Nz::RefCounted
 RefCounted (bool persistent=true)
 Constructs a RefCounted object with a persistance aspect. More...
 
 RefCounted (const RefCounted &)=delete
 
 RefCounted (RefCounted &&)=default
 
virtual ~RefCounted ()
 Destructs the object. More...
 
void AddReference () const
 Adds a reference to the object.
 
unsigned int GetReferenceCount () const
 Gets the number of references to the object. More...
 
bool IsPersistent () const
 Checks whether the object is persistent. More...
 
bool RemoveReference () const
 Removes a reference to the object. More...
 
bool SetPersistent (bool persistent=true, bool checkReferenceCount=false)
 Sets the persistence of the object. More...
 
RefCountedoperator= (const RefCounted &)=delete
 
RefCountedoperator= (RefCounted &&)=default
 

Static Public Member Functions

static ParticleDeclarationGet (ParticleLayout layout)
 Gets the particle declaration based on the layout. More...
 
static bool IsTypeSupported (ComponentType type)
 Checks whether the type is supported. More...
 
template<typename... Args>
static ParticleDeclarationRef New (Args &&... args)
 

Friends

class Graphics
 

Detailed Description

Graphics class that represents the declaration of the particle, works like an ECS.

Constructor & Destructor Documentation

◆ ParticleDeclaration()

Nz::ParticleDeclaration::ParticleDeclaration ( const ParticleDeclaration declaration)

Constructs a ParticleDeclaration object by assignation.

Parameters
declarationParticleDeclaration to copy into this

◆ ~ParticleDeclaration()

Nz::ParticleDeclaration::~ParticleDeclaration ( )

Destructs the object and calls OnParticleDeclarationRelease.

See also
OnParticleDeclarationRelease

Member Function Documentation

◆ DisableComponent()

void Nz::ParticleDeclaration::DisableComponent ( ParticleComponent  component)

Disables a component.

Parameters
componentComponent to disable in the declaration
Remarks
Produces a NazaraError with NAZARA_DEBUG defined if enumeration is invalid
Produces a NazaraError with NAZARA_GRAPHICS_SAFE defined if enumeration is equal to ParticleComponent_Unused

◆ EnableComponent()

void Nz::ParticleDeclaration::EnableComponent ( ParticleComponent  component,
ComponentType  type,
std::size_t  offset 
)

Enables a component.

Parameters
componentComponent to enable in the declaration
typeType of this component
offsetOffset in the declaration
Remarks
Produces a NazaraError with NAZARA_DEBUG defined if enumeration is invalid
Produces a NazaraError with NAZARA_GRAPHICS_SAFE defined if type is not supported

◆ Get()

ParticleDeclaration * Nz::ParticleDeclaration::Get ( ParticleLayout  layout)
static

Gets the particle declaration based on the layout.

Returns
Pointer to the declaration
Parameters
layoutLayout of the particle declaration
Remarks
Produces a NazaraError with NAZARA_DEBUG if enumeration is invalid

◆ GetComponent()

void Nz::ParticleDeclaration::GetComponent ( ParticleComponent  component,
bool *  enabled,
ComponentType *  type,
std::size_t *  offset 
) const

Gets a component.

Parameters
componentComponent in the declaration
enabledOptional argument to get if this component is enabled
typeOptional argument to get if the type of the component
offsetOptional argument to get if the offset in the declaration
Remarks
Produces a NazaraError with NAZARA_DEBUG defined if enumeration is invalid
Produces a NazaraError with NAZARA_GRAPHICS_SAFE defined if enumeration is equal to ParticleComponent_Unused

◆ GetStride()

std::size_t Nz::ParticleDeclaration::GetStride ( ) const

Gets the stride of the declaration.

Returns
Stride of the declaration

◆ IsTypeSupported()

bool Nz::ParticleDeclaration::IsTypeSupported ( ComponentType  type)
static

Checks whether the type is supported.

Returns
true If it is the case
Parameters
typeType of the component
Remarks
Produces a NazaraError if enumeration is invalid

◆ operator=()

ParticleDeclaration & Nz::ParticleDeclaration::operator= ( const ParticleDeclaration declaration)

Sets the current particle declaration with the content of the other one.

Returns
A reference to this
Parameters
declarationThe other ParticleDeclaration

◆ SetStride()

void Nz::ParticleDeclaration::SetStride ( unsigned int  stride)

Sets the stride of the declaration.

Parameters
strideStride of the declaration

The documentation for this class was generated from the following files: