Castor3D  ..
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Castor3D::FrameVariable Class Referenceabstract

Shader variable representation. More...

+ Inheritance diagram for Castor3D::FrameVariable:
+ Collaboration diagram for Castor3D::FrameVariable:

Classes

class  TextLoader
 FrameVariable loader. More...
 

Public Member Functions

C3D_API FrameVariable (ShaderProgram *p_program)
 Constructor. More...
 
C3D_API FrameVariable (ShaderProgram *p_program, uint32_t p_occurences)
 Constructor. More...
 
C3D_API FrameVariable (FrameVariable const &p_object)
 Copy constructor. More...
 
C3D_API FrameVariable (FrameVariable &&p_object)
 Move constructor. More...
 
C3D_API FrameVariableoperator= (FrameVariable const &p_object)
 Copy assignment operator. More...
 
C3D_API FrameVariableoperator= (FrameVariable &&p_object)
 Move assignment operator. More...
 
virtual C3D_API ~FrameVariable ()
 Destructor. More...
 
virtual C3D_API bool Initialise ()=0
 Initialises the variable. More...
 
virtual C3D_API void Cleanup ()=0
 Cleans up the variable. More...
 
virtual C3D_API void Bind ()=0
 Binds this variable to the shader. More...
 
virtual C3D_API void Unbind ()=0
 Unbinds this variable from the shader. More...
 
virtual C3D_API eFRAME_VARIABLE_TYPE GetFullType () const =0
 Gives the variable full type. More...
 
virtual C3D_API eVARIABLE_TYPE GetType () const =0
 Gives the variable dimension. More...
 
virtual C3D_API Castor::String GetFullTypeName () const =0
 Gives the variable full type name. More...
 
virtual C3D_API Castor::String GetDataTypeName () const =0
 Gives the variable data type name. More...
 
virtual C3D_API void SetValueStr (Castor::String const &p_value)
 Defines the value of the variable, from a string. More...
 
virtual C3D_API void SetValueStr (Castor::String const &p_value, uint32_t p_index)
 Defines the value of the variable, from a string. More...
 
virtual void SetName (Castor::String const &p_name)
 Defines the name of the variable, as it appears in the shader program. More...
 
Castor::String GetName () const
 Gives the name of the variable, as it appears in the shader program. More...
 
Castor::String GetStrValue () const
 Retrieves the variable string value. More...
 
Castor::String GetStrValue (uint32_t p_index) const
 Retrieves the variable string value at given index. More...
 
virtual uint8_t const *const const_ptr () const =0
 Retrieves a pointer to the variable data. More...
 
virtual uint32_t size () const =0
 Retrieves the byte size of the variable. More...
 
virtual void link (uint8_t *p_buffer)=0
 Defines the buffer holding the frame variable. More...
 
const uint32_t & GetOccCount () const
 Retrieves the occurences count. More...
 
ShaderProgramGetProgram () const
 Retrieves the parent program. More...
 

Protected Member Functions

virtual C3D_API void DoSetValueStr (Castor::String const &p_value, uint32_t p_index)=0
 Defines the value of the variable, from a string. More...
 

Protected Attributes

Castor::String m_name
 The variable name as it appears in the shader program. More...
 
bool m_changed
 Tells if the variable has changed since last execution of the shader. More...
 
uint32_t m_occurences
 The array dimension if the variable represents an array. More...
 
Castor::StringArray m_strValue
 The value of the variable. More...
 
ShaderProgramm_program
 The parent shader program. More...
 

Detailed Description

Shader variable representation.

Author
Sylvain DOREMUS
Version
0.6.1.0
Date
14/08/2010
Remarks
This is a variable that is given to a shader program during it's execution

Constructor & Destructor Documentation

◆ FrameVariable() [1/4]

C3D_API Castor3D::FrameVariable::FrameVariable ( ShaderProgram p_program)

Constructor.

Parameters
[in]p_programThe program

◆ FrameVariable() [2/4]

C3D_API Castor3D::FrameVariable::FrameVariable ( ShaderProgram p_program,
uint32_t  p_occurences 
)

Constructor.

Parameters
[in]p_programThe program
[in]p_occurencesThe array dimension

◆ FrameVariable() [3/4]

C3D_API Castor3D::FrameVariable::FrameVariable ( FrameVariable const &  p_object)

Copy constructor.

Parameters
[in]p_objectThe object to copy

◆ FrameVariable() [4/4]

C3D_API Castor3D::FrameVariable::FrameVariable ( FrameVariable &&  p_object)

Move constructor.

Parameters
[in]p_objectThe object to move

◆ ~FrameVariable()

virtual C3D_API Castor3D::FrameVariable::~FrameVariable ( )
virtual

Destructor.

Member Function Documentation

◆ Bind()

virtual C3D_API void Castor3D::FrameVariable::Bind ( )
pure virtual

Binds this variable to the shader.

◆ Cleanup()

virtual C3D_API void Castor3D::FrameVariable::Cleanup ( )
pure virtual

Cleans up the variable.

◆ const_ptr()

virtual uint8_t const* const Castor3D::FrameVariable::const_ptr ( ) const
pure virtual

Retrieves a pointer to the variable data.

Returns
The pointer

Implemented in Castor3D::TFrameVariable< T >.

◆ DoSetValueStr()

virtual C3D_API void Castor3D::FrameVariable::DoSetValueStr ( Castor::String const &  p_value,
uint32_t  p_index 
)
protectedpure virtual

Defines the value of the variable, from a string.

Parameters
[in]p_indexThe index of the value
[in]p_valueThe string containing the value

◆ GetDataTypeName()

virtual C3D_API Castor::String Castor3D::FrameVariable::GetDataTypeName ( ) const
pure virtual

Gives the variable data type name.

Returns
The data type name

Implemented in Castor3D::TFrameVariable< T >.

◆ GetFullType()

virtual C3D_API eFRAME_VARIABLE_TYPE Castor3D::FrameVariable::GetFullType ( ) const
pure virtual

Gives the variable full type.

Returns
The type

Donne le type complet de la variable

Returns
Le type

Implemented in Castor3D::OneFrameVariable< T >, Castor3D::MatrixFrameVariable< T, Rows, Columns >, and Castor3D::PointFrameVariable< T, Count >.

◆ GetFullTypeName()

virtual C3D_API Castor::String Castor3D::FrameVariable::GetFullTypeName ( ) const
pure virtual

Gives the variable full type name.

Returns
The type

Donne le nom du type complet de la variable

Returns
Le type

Implemented in Castor3D::OneFrameVariable< T >, Castor3D::MatrixFrameVariable< T, Rows, Columns >, and Castor3D::PointFrameVariable< T, Count >.

◆ GetName()

Castor::String Castor3D::FrameVariable::GetName ( ) const
inline

Gives the name of the variable, as it appears in the shader program.

Returns
The variable name

References m_name.

◆ GetOccCount()

const uint32_t& Castor3D::FrameVariable::GetOccCount ( ) const
inline

Retrieves the occurences count.

Returns
The value

References m_occurences.

◆ GetProgram()

ShaderProgram* Castor3D::FrameVariable::GetProgram ( ) const
inline

Retrieves the parent program.

Returns
The program

References m_program.

◆ GetStrValue() [1/2]

Castor::String Castor3D::FrameVariable::GetStrValue ( ) const
inline

Retrieves the variable string value.

Returns
The value

References m_strValue.

◆ GetStrValue() [2/2]

Castor::String Castor3D::FrameVariable::GetStrValue ( uint32_t  p_index) const
inline

Retrieves the variable string value at given index.

Parameters
[in]p_indexThe index
Returns
The value

References m_occurences, and m_strValue.

◆ GetType()

virtual C3D_API eVARIABLE_TYPE Castor3D::FrameVariable::GetType ( ) const
pure virtual

Gives the variable dimension.

Returns
The dimension

Donne la dimension de la variable

Returns
La dimension

Implemented in Castor3D::OneFrameVariable< T >, Castor3D::MatrixFrameVariable< T, Rows, Columns >, and Castor3D::PointFrameVariable< T, Count >.

◆ Initialise()

virtual C3D_API bool Castor3D::FrameVariable::Initialise ( )
pure virtual

Initialises the variable.

Returns
false if any problem occured

◆ link()

virtual void Castor3D::FrameVariable::link ( uint8_t *  p_buffer)
pure virtual

Defines the buffer holding the frame variable.

Remarks
The variable no longer owns it's buffer
Parameters
[in]p_bufferThe buffer

Implemented in Castor3D::TFrameVariable< T >, and Castor3D::MatrixFrameVariable< T, Rows, Columns >.

◆ operator=() [1/2]

C3D_API FrameVariable& Castor3D::FrameVariable::operator= ( FrameVariable const &  p_object)

Copy assignment operator.

Parameters
[in]p_objectThe object to copy
Returns
A reference to this object

◆ operator=() [2/2]

C3D_API FrameVariable& Castor3D::FrameVariable::operator= ( FrameVariable &&  p_object)

Move assignment operator.

Parameters
[in]p_objectThe object to move
Returns
A reference to this object

◆ SetName()

virtual void Castor3D::FrameVariable::SetName ( Castor::String const &  p_name)
inlinevirtual

Defines the name of the variable, as it appears in the shader program.

Parameters
[in]p_nameThe variable name

References m_name.

◆ SetValueStr() [1/2]

virtual C3D_API void Castor3D::FrameVariable::SetValueStr ( Castor::String const &  p_value)
virtual

Defines the value of the variable, from a string.

Parameters
[in]p_valueThe string containing the value

◆ SetValueStr() [2/2]

virtual C3D_API void Castor3D::FrameVariable::SetValueStr ( Castor::String const &  p_value,
uint32_t  p_index 
)
virtual

Defines the value of the variable, from a string.

Parameters
[in]p_indexThe index of the value
[in]p_valueThe string containing the value

◆ size()

virtual uint32_t Castor3D::FrameVariable::size ( ) const
pure virtual

Retrieves the byte size of the variable.

Returns
The size

Implemented in Castor3D::OneFrameVariable< T >, Castor3D::PointFrameVariable< T, Count >, and Castor3D::MatrixFrameVariable< T, Rows, Columns >.

◆ Unbind()

virtual C3D_API void Castor3D::FrameVariable::Unbind ( )
pure virtual

Unbinds this variable from the shader.

Member Data Documentation

◆ m_changed

bool Castor3D::FrameVariable::m_changed
protected

Tells if the variable has changed since last execution of the shader.

◆ m_name

Castor::String Castor3D::FrameVariable::m_name
protected

The variable name as it appears in the shader program.

Referenced by GetName(), and SetName().

◆ m_occurences

uint32_t Castor3D::FrameVariable::m_occurences
protected

The array dimension if the variable represents an array.

Referenced by GetOccCount(), and GetStrValue().

◆ m_program

ShaderProgram* Castor3D::FrameVariable::m_program
protected

The parent shader program.

Referenced by GetProgram().

◆ m_strValue

Castor::StringArray Castor3D::FrameVariable::m_strValue
protected

The value of the variable.

Referenced by GetStrValue().


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