orx  stable
Portable Game Engine
OrxShader

Data Structures

struct  orxSHADER_EVENT_PAYLOAD
 
struct  orxSHADER_PARAM
 

Typedefs

typedef struct __orxSHADER_t orxSHADER
 

Enumerations

enum  orxSHADER_EVENT { orxSHADER_EVENT_SET_PARAM = 0, orxSHADER_EVENT_NUMBER, orxSHADER_EVENT_NONE = orxENUM_NONE }
 
enum  orxSHADER_PARAM_TYPE {
  orxSHADER_PARAM_TYPE_FLOAT = 0, orxSHADER_PARAM_TYPE_TEXTURE, orxSHADER_PARAM_TYPE_VECTOR, orxSHADER_PARAM_TYPE_TIME,
  orxSHADER_PARAM_TYPE_NUMBER, orxSHADER_PARAM_TYPE_NONE = orxENUM_NONE
}
 

Functions

orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddFloatParam (orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxFLOAT *_afValueList)
 
orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddTextureParam (orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxTEXTURE **_apstValueList)
 
orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddTimeParam (orxSHADER *_pstShader, const orxSTRING _zName)
 
orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddVectorParam (orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxVECTOR *_avValueList)
 
orxDLLAPI orxSTATUS orxFASTCALL orxShader_ClearCache ()
 
orxDLLAPI orxSTATUS orxFASTCALL orxShader_CompileCode (orxSHADER *_pstShader, const orxSTRING *_azCodeList, orxU32 _u32Size)
 
orxDLLAPI orxSHADER *orxFASTCALL orxShader_Create ()
 
orxDLLAPI orxSHADER *orxFASTCALL orxShader_CreateFromConfig (const orxSTRING _zConfigID)
 
orxDLLAPI orxSTATUS orxFASTCALL orxShader_Delete (orxSHADER *_pstShader)
 
orxDLLAPI void orxFASTCALL orxShader_Enable (orxSHADER *_pstShader, orxBOOL _bEnable)
 
orxDLLAPI void orxFASTCALL orxShader_Exit ()
 
orxDLLAPI const orxSTRING orxFASTCALL orxShader_GetName (const orxSHADER *_pstShader)
 
orxDLLAPI orxSTATUS orxFASTCALL orxShader_Init ()
 
orxDLLAPI orxBOOL orxFASTCALL orxShader_IsEnabled (const orxSHADER *_pstShader)
 
orxDLLAPI orxSTATUS orxFASTCALL orxShader_SetFloatParam (orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxFLOAT *_afValueList)
 
orxDLLAPI orxSTATUS orxFASTCALL orxShader_SetTextureParam (orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxTEXTURE **_apstValueList)
 
orxDLLAPI void orxFASTCALL orxShader_Setup ()
 
orxDLLAPI orxSTATUS orxFASTCALL orxShader_SetVectorParam (orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxVECTOR *_avValueList)
 
orxDLLAPI orxSTATUS orxFASTCALL orxShader_Start (const orxSHADER *_pstShader, const orxSTRUCTURE *_pstOwner)
 
orxDLLAPI orxSTATUS orxFASTCALL orxShader_Stop (const orxSHADER *_pstShader)
 

Detailed Description

Shader module Allows to store shader information (code + parameters).

Typedef Documentation

typedef struct __orxSHADER_t orxSHADER

Internal shader structure

Definition at line 84 of file orxShader.h.

Enumeration Type Documentation

Event enum

Enumerator
orxSHADER_EVENT_SET_PARAM 

Event sent when setting a parameter

orxSHADER_EVENT_NUMBER 
orxSHADER_EVENT_NONE 

Definition at line 89 of file orxShader.h.

Shader parameter type

Enumerator
orxSHADER_PARAM_TYPE_FLOAT 
orxSHADER_PARAM_TYPE_TEXTURE 
orxSHADER_PARAM_TYPE_VECTOR 
orxSHADER_PARAM_TYPE_TIME 
orxSHADER_PARAM_TYPE_NUMBER 
orxSHADER_PARAM_TYPE_NONE 

Definition at line 56 of file orxShader.h.

Function Documentation

orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddFloatParam ( orxSHADER _pstShader,
const orxSTRING  _zName,
orxU32  _u32ArraySize,
const orxFLOAT *  _afValueList 
)

Adds a float parameter definition to a shader (parameters need to be set before compiling the shader code)

Parameters
[in]_pstShaderConcerned Shader
[in]_zNameParameter's literal name
[in]_u32ArraySizeParameter's array size, 0 for simple variable
[in]_afValueListParameter's float value list
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddTextureParam ( orxSHADER _pstShader,
const orxSTRING  _zName,
orxU32  _u32ArraySize,
const orxTEXTURE **  _apstValueList 
)

Adds a texture parameter definition to a shader (parameters need to be set before compiling the shader code)

Parameters
[in]_pstShaderConcerned Shader
[in]_zNameParameter's literal name
[in]_u32ArraySizeParameter's array size, 0 simple variable
[in]_apstValueListParameter's texture value list
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddTimeParam ( orxSHADER _pstShader,
const orxSTRING  _zName 
)

Adds a time parameter definition to a shader (parameters need to be set before compiling the shader code)

Parameters
[in]_pstShaderConcerned Shader
[in]_zNameParameter's literal name
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddVectorParam ( orxSHADER _pstShader,
const orxSTRING  _zName,
orxU32  _u32ArraySize,
const orxVECTOR _avValueList 
)

Adds a vector parameter definition to a shader (parameters need to be set before compiling the shader code)

Parameters
[in]_pstShaderConcerned Shader
[in]_zNameParameter's literal name
[in]_u32ArraySizeParameter's array size, 0 for simple variable
[in]_avValueListParameter's vector value list
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxShader_ClearCache ( )

Clears cache (if any shader is still in active use, it'll remain in memory until not referenced anymore)

Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxShader_CompileCode ( orxSHADER _pstShader,
const orxSTRING *  _azCodeList,
orxU32  _u32Size 
)

Sets shader code & compiles it (parameters need to be set before compiling the shader code)

Parameters
[in]_pstShaderConcerned Shader
[in]_azCodeListList of shader codes to compile (parameters need to be set beforehand), will be processed in order
[in]_u32SizeSize of the shader code list
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSHADER* orxFASTCALL orxShader_Create ( )

Creates an empty shader

Returns
orxSHADER / orxNULL
orxDLLAPI orxSHADER* orxFASTCALL orxShader_CreateFromConfig ( const orxSTRING  _zConfigID)

Creates a shader from config

Parameters
[in]_zConfigIDConfig ID @ return orxSHADER / orxNULL
orxDLLAPI orxSTATUS orxFASTCALL orxShader_Delete ( orxSHADER _pstShader)

Deletes a shader

Parameters
[in]_pstShaderConcerned Shader
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI void orxFASTCALL orxShader_Enable ( orxSHADER _pstShader,
orxBOOL  _bEnable 
)

Enables/disables a shader

Parameters
[in]_pstShaderConcerned Shader
[in]_bEnableEnable / disable
orxDLLAPI void orxFASTCALL orxShader_Exit ( )

Exits from the shader module

orxDLLAPI const orxSTRING orxFASTCALL orxShader_GetName ( const orxSHADER _pstShader)

Gets shader name

Parameters
[in]_pstShaderConcerned Shader
Returns
orxSTRING / orxSTRING_EMPTY
orxDLLAPI orxSTATUS orxFASTCALL orxShader_Init ( )

Inits the shader module

Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxBOOL orxFASTCALL orxShader_IsEnabled ( const orxSHADER _pstShader)

Is shader enabled?

Parameters
[in]_pstShaderConcerned Shader
Returns
orxTRUE if enabled, orxFALSE otherwise
orxDLLAPI orxSTATUS orxFASTCALL orxShader_SetFloatParam ( orxSHADER _pstShader,
const orxSTRING  _zName,
orxU32  _u32ArraySize,
const orxFLOAT *  _afValueList 
)

Sets the default value for a given float parameter in a shader (parameters need to be added beforehand)

Parameters
[in]_pstShaderConcerned Shader
[in]_zNameParameter's literal name
[in]_u32ArraySizeParameter's array size, 0 for simple variable, has to match the size used when declaring the parameter
[in]_afValueListParameter's float value list
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxShader_SetTextureParam ( orxSHADER _pstShader,
const orxSTRING  _zName,
orxU32  _u32ArraySize,
const orxTEXTURE **  _apstValueList 
)

Sets the default value for a given float parameter in a shader (parameters need to be added beforehand)

Parameters
[in]_pstShaderConcerned Shader
[in]_zNameParameter's literal name
[in]_u32ArraySizeParameter's array size, 0 for simple variable, has to match the size used when declaring the parameter
[in]_apstValueListParameter's texture value list
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI void orxFASTCALL orxShader_Setup ( )

Shader module setup

orxDLLAPI orxSTATUS orxFASTCALL orxShader_SetVectorParam ( orxSHADER _pstShader,
const orxSTRING  _zName,
orxU32  _u32ArraySize,
const orxVECTOR _avValueList 
)

Sets the default value for a given float parameter in a shader (parameters need to be added beforehand)

Parameters
[in]_pstShaderConcerned Shader
[in]_zNameParameter's literal name
[in]_u32ArraySizeParameter's array size, 0 for simple variable, has to match the size used when declaring the parameter
[in]_avValueListParameter's vector value list
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxShader_Start ( const orxSHADER _pstShader,
const orxSTRUCTURE _pstOwner 
)

Starts a shader

Parameters
[in]_pstShaderConcerned Shader
[in]_pstOwnerOwner structure (orxOBJECT / orxVIEWPORT / orxNULL)
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE
orxDLLAPI orxSTATUS orxFASTCALL orxShader_Stop ( const orxSHADER _pstShader)

Stops a shader

Parameters
[in]_pstShaderConcerned Shader
Returns
orxSTATUS_SUCCESS / orxSTATUS_FAILURE

Generated for orx by doxygen 1.5.6