orx  stable
Portable Game Engine
orxShader.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2017 Orx-Project
4  *
5  * This software is provided 'as-is', without any express or implied
6  * warranty. In no event will the authors be held liable for any damages
7  * arising from the use of this software.
8  *
9  * Permission is granted to anyone to use this software for any purpose,
10  * including commercial applications, and to alter it and redistribute it
11  * freely, subject to the following restrictions:
12  *
13  * 1. The origin of this software must not be misrepresented; you must not
14  * claim that you wrote the original software. If you use this software
15  * in a product, an acknowledgment in the product documentation would be
16  * appreciated but is not required.
17  *
18  * 2. Altered source versions must be plainly marked as such, and must not be
19  * misrepresented as being the original software.
20  *
21  * 3. This notice may not be removed or altered from any source
22  * distribution.
23  */
24 
43 #ifndef _orxSHADER_H_
44 #define _orxSHADER_H_
45 
46 
47 #include "orxInclude.h"
48 #include "math/orxVector.h"
49 #include "display/orxTexture.h"
50 #include "object/orxObject.h"
51 #include "utils/orxLinkList.h"
52 
53 
56 typedef enum __orxSHADER_PARAM_TYPE_t
57 {
62 
64 
66 
68 
69 
72 typedef struct __orxSHADER_PARAM_t
73 {
76  const orxSTRING zName;
77  orxU32 u32ArraySize;
80 
81 
84 typedef struct __orxSHADER_t orxSHADER;
85 
86 
89 typedef enum __orxSHADER_EVENT_t
90 {
94 
95  orxSHADER_EVENT_NONE = orxENUM_NONE
96 
98 
101 typedef struct __orxSHADER_EVENT_PAYLOAD_t
102 {
104  const orxSTRING zShaderName;
107  const orxSTRING zParamName;
108  orxS32 s32ParamIndex;
110  union
111  {
112  orxFLOAT fValue;
115  };
118 
119 
122 extern orxDLLAPI void orxFASTCALL orxShader_Setup();
123 
127 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_Init();
128 
131 extern orxDLLAPI void orxFASTCALL orxShader_Exit();
132 
136 extern orxDLLAPI orxSHADER *orxFASTCALL orxShader_Create();
137 
142 extern orxDLLAPI orxSHADER *orxFASTCALL orxShader_CreateFromConfig(const orxSTRING _zConfigID);
143 
148 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_Delete(orxSHADER *_pstShader);
149 
153 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_ClearCache();
154 
160 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_Start(const orxSHADER *_pstShader, const orxSTRUCTURE *_pstOwner);
161 
166 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_Stop(const orxSHADER *_pstShader);
167 
168 
176 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddFloatParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxFLOAT *_afValueList);
177 
185 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddTextureParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxTEXTURE **_apstValueList);
186 
194 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddVectorParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxVECTOR *_avValueList);
195 
201 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddTimeParam(orxSHADER *_pstShader, const orxSTRING _zName);
202 
210 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_SetFloatParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxFLOAT *_afValueList);
211 
219 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_SetTextureParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxTEXTURE **_apstValueList);
220 
228 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_SetVectorParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxVECTOR *_avValueList);
229 
236 extern orxDLLAPI orxSTATUS orxFASTCALL orxShader_CompileCode(orxSHADER *_pstShader, const orxSTRING *_azCodeList, orxU32 _u32Size);
237 
242 extern orxDLLAPI void orxFASTCALL orxShader_Enable(orxSHADER *_pstShader, orxBOOL _bEnable);
243 
248 extern orxDLLAPI orxBOOL orxFASTCALL orxShader_IsEnabled(const orxSHADER *_pstShader);
249 
254 extern orxDLLAPI const orxSTRING orxFASTCALL orxShader_GetName(const orxSHADER *_pstShader);
255 
256 #endif /* _orxSHADER_H_ */
257 
orxSHADER_EVENT
Definition: orxShader.h:89
orxDLLAPI orxSTATUS orxFASTCALL orxShader_Stop(const orxSHADER *_pstShader)
orxDLLAPI void orxFASTCALL orxShader_Enable(orxSHADER *_pstShader, orxBOOL _bEnable)
orxDLLAPI void orxFASTCALL orxShader_Setup()
orxDLLAPI orxSHADER *orxFASTCALL orxShader_CreateFromConfig(const orxSTRING _zConfigID)
orxDLLAPI orxSTATUS orxFASTCALL orxShader_SetTextureParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxTEXTURE **_apstValueList)
struct __orxTEXTURE_t orxTEXTURE
Definition: orxTexture.h:77
orxDLLAPI orxSTATUS orxFASTCALL orxShader_ClearCache()
struct __orxSHADER_t orxSHADER
Definition: orxShader.h:84
orxDLLAPI orxSTATUS orxFASTCALL orxShader_Start(const orxSHADER *_pstShader, const orxSTRUCTURE *_pstOwner)
orxDLLAPI orxSTATUS orxFASTCALL orxShader_SetVectorParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxVECTOR *_avValueList)
orxSHADER_PARAM_TYPE
Definition: orxShader.h:56
const orxSTRING zParamName
Definition: orxShader.h:107
const orxSTRING zName
Definition: orxShader.h:76
const orxSHADER * pstShader
Definition: orxShader.h:103
orxSHADER_PARAM_TYPE eParamType
Definition: orxShader.h:106
orxU32 u32ArraySize
Definition: orxShader.h:77
orxDLLAPI orxSTATUS orxFASTCALL orxShader_Delete(orxSHADER *_pstShader)
orxDLLAPI const orxSTRING orxFASTCALL orxShader_GetName(const orxSHADER *_pstShader)
orxSTATUS
Definition: orxType.h:243
orxDLLAPI orxSHADER *orxFASTCALL orxShader_Create()
orxSHADER_PARAM_TYPE eType
Definition: orxShader.h:75
#define orxDLLAPI
Definition: orxDecl.h:387
orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddFloatParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxFLOAT *_afValueList)
orxDLLAPI orxBOOL orxFASTCALL orxShader_IsEnabled(const orxSHADER *_pstShader)
orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddTimeParam(orxSHADER *_pstShader, const orxSTRING _zName)
const orxSTRING zShaderName
Definition: orxShader.h:104
orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddTextureParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxTEXTURE **_apstValueList)
orxLINKLIST_NODE stNode
Definition: orxShader.h:74
const orxTEXTURE * pstValue
Definition: orxShader.h:113
orxDLLAPI orxSTATUS orxFASTCALL orxShader_Init()
orxDLLAPI orxSTATUS orxFASTCALL orxShader_CompileCode(orxSHADER *_pstShader, const orxSTRING *_azCodeList, orxU32 _u32Size)
orxDLLAPI orxSTATUS orxFASTCALL orxShader_SetFloatParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxFLOAT *_afValueList)
orxDLLAPI void orxFASTCALL orxShader_Exit()
orxDLLAPI orxSTATUS orxFASTCALL orxShader_AddVectorParam(orxSHADER *_pstShader, const orxSTRING _zName, orxU32 _u32ArraySize, const orxVECTOR *_avValueList)

Generated for orx by doxygen 1.5.6