Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00043 #ifndef _orxSHADER_H_
00044 #define _orxSHADER_H_
00045
00046
00047 #include "orxInclude.h"
00048 #include "math/orxVector.h"
00049 #include "display/orxTexture.h"
00050 #include "object/orxObject.h"
00051 #include "utils/orxLinkList.h"
00052
00053
00056 typedef enum __orxSHADER_PARAM_TYPE_t
00057 {
00058 orxSHADER_PARAM_TYPE_FLOAT = 0,
00059 orxSHADER_PARAM_TYPE_TEXTURE,
00060 orxSHADER_PARAM_TYPE_VECTOR,
00061
00062 orxSHADER_PARAM_TYPE_NUMBER,
00063
00064 orxSHADER_PARAM_TYPE_NONE = orxENUM_NONE
00065
00066 } orxSHADER_PARAM_TYPE;
00067
00068
00071 typedef struct __orxSHADER_PARAM_t
00072 {
00073 orxLINKLIST_NODE stNode;
00074 orxSHADER_PARAM_TYPE eType;
00075 const orxSTRING zName;
00076 orxU32 u32ArraySize;
00078 } orxSHADER_PARAM;
00079
00080
00083 typedef struct __orxSHADER_t orxSHADER;
00084
00085
00088 typedef enum __orxSHADER_EVENT_t
00089 {
00090 orxSHADER_EVENT_SET_PARAM = 0,
00092 orxSHADER_EVENT_NUMBER,
00093
00094 orxSHADER_EVENT_NONE = orxENUM_NONE
00095
00096 } orxSHADER_EVENT;
00097
00100 typedef struct __orxSHADER_EVENT_PAYLOAD_t
00101 {
00102 const orxSHADER *pstShader;
00103 const orxSTRING zShaderName;
00105 orxSHADER_PARAM_TYPE eParamType;
00106 const orxSTRING zParamName;
00107 orxS32 s32ParamIndex;
00109 union
00110 {
00111 orxFLOAT fValue;
00112 const orxTEXTURE *pstValue;
00113 orxVECTOR vValue;
00114 };
00116 } orxSHADER_EVENT_PAYLOAD;
00117
00118
00121 extern orxDLLAPI void orxFASTCALL orxShader_Setup();
00122
00126 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_Init();
00127
00130 extern orxDLLAPI void orxFASTCALL orxShader_Exit();
00131
00135 extern orxDLLAPI orxSHADER *orxFASTCALL orxShader_Create();
00136
00141 extern orxDLLAPI orxSHADER *orxFASTCALL orxShader_CreateFromConfig(const orxSTRING _zConfigID);
00142
00147 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_Delete(orxSHADER *_pstShader);
00148
00154 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_Start(const orxSHADER *_pstShader, const orxSTRUCTURE *_pstOwner);
00155
00160 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_Stop(const orxSHADER *_pstShader);
00161
00162
00170 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddFloatParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxFLOAT *_afValueList);
00171
00179 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddTextureParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxTEXTURE **_apstValueList);
00180
00188 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddVectorParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxVECTOR *_avValueList);
00189
00195 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_CompileCode(orxSHADER *_pstShader, const orxSTRING _zCode);
00196
00201 extern orxDLLAPI const orxLINKLIST *orxFASTCALL orxShader_GetParamList(const orxSHADER *_pstShader);
00202
00207 extern orxDLLAPI void orxFASTCALL orxShader_Enable(orxSHADER *_pstShader, orxBOOL _bEnable);
00208
00213 extern orxDLLAPI orxBOOL orxFASTCALL orxShader_IsEnabled(const orxSHADER *_pstShader);
00214
00219 extern orxDLLAPI const orxSTRING orxFASTCALL orxShader_GetName(const orxSHADER *_pstShader);
00220
00221 #endif
00222