OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreCgFxScriptLoader.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OGRE
4 (Object-oriented Graphics Rendering Engine)
5 For the latest info, see http://www.ogre3d.org
6 
7 Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9 Permission is hereby granted, free of charge, to any person obtaining a copy
10 of this software and associated documentation files (the "Software"), to deal
11 in the Software without restriction, including without limitation the rights
12 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 copies of the Software, and to permit persons to whom the Software is
14 furnished to do so, subject to the following conditions:
15 
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18 
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 THE SOFTWARE.
26 -----------------------------------------------------------------------------
27 */
28 #ifndef __CgFxScriptLoader_H__
29 #define __CgFxScriptLoader_H__
30 
31 #include "OgrePrerequisites.h"
32 #include "OgreSingleton.h"
33 #include "OgreStringVector.h"
34 #include "OgreScriptLoader.h"
35 #include "OgreCgPrerequisites.h"
36 #include "OgreTexture.h"
37 #include "OgreTextureUnitState.h"
38 #include "OgreGpuProgram.h"
39 
40 namespace Ogre {
41 
47  class CgFxScriptLoader : public Singleton<CgFxScriptLoader>, public ScriptLoader, public ScriptCompilerAlloc
48  {
49  public:
50  protected:
58  {
61  FXS_POSITION, // desc="A position vector." datatypes="float3"
62  FXS_DIRECTION, // desc="A direction vector." datatypes="float3"
64  FXS_DIFFUSE, // desc="Color value to be used as the diffuse color. The fourth channel represents diffuse alpha." datatypes="float4,float3,texture"
65  FXS_SPECULAR, // desc="Color value to be used as the specular color. The fourth channel represents specular alpha." datatypes="float4,float3,texture"
66  FXS_AMBIENT, // desc="Color value to be used as the ambient color. The fourth channel represents ambient alpha." datatypes="float4,float3,texture"
68  FXS_EMISSIVE, // desc="Color value to be used as the emissive color. The fourth channel represents emissive alpha." datatypes="float4,float3,texture"
69  FXS_SPECULARPOWER, // desc="Power to use for the specular exponent." datatypes="float,float3,float4"
70  FXS_REFRACTION, // desc="A refraction map that give the coefficents to determine the norma for an environment map lookup" datatypes="texture"
71  FXS_OPACITY, // desc="Opacity of the object." datatypes="texture"
72  FXS_ENVIRONMENT, // desc="An environment map." datatypes="texture"
73  FXS_ENVIRONMENTNORMAL, // name="environmentnormal" desc="An environment normal map." datatypes="texture"
74  FXS_NORMAL, // desc="Normal for the element or texture" datatypes="texture"
75  FXS_HEIGHT, // desc="Height for the element when using bump mapping." datatypes="texture"
76  FXS_ATTENUATION, // desc="Light attenuation." datatypes="float3"
77  FXS_RENDERCOLORTARGET, // desc="Defines the texture as the render target of a pass in the effect." datatypes="texture"
78  FXS_RENDERDEPTHSTENCILTARGET, // desc="Defines the texture as the render target of a pass in the effect." datatypes="texture"
79  FXS_VIEWPORTPIXELSIZE, // desc="Size of the viewport in pixels" datatypes="float2"
80  FXS_CAMERAPOSITION, // desc="Viewer position in world space (replaced by position with space=view annotation)." datatypes="float3"
81  FXS_TIME, // desc="The current time (see units annotation for scale)." datatypes="float"
82  FXS_ELAPSEDTIME, // desc="The time between adjacent frames (see units annotation for scale)." datatypes="float"
85  FXS_MOUSEPOSITION, // desc="The mouse position on screen (x,y,time)" datatypes="float3"
86  FXS_LEFTMOUSEDOWN, // desc="The left mouse down state, and its position at that time ( x, y, isdown, timedown)" datatypes="float4"
87  FXS_WORLD, // desc="world-inverse matrix." datatypes="matrix"
88  FXS_VIEW, // desc="view matrix." datatypes="matrix"
89  FXS_PROJECTION, // desc="projection matrix." datatypes="matrix"
90  FXS_WORLDTRANSPOSE, // desc="world-transpose matrix." datatypes="matrix"
91  FXS_VIEWTRANSPOSE, // name="worldviewtranspose" desc="world-view-transpose matrix." datatypes="matrix"
92  FXS_PROJECTIONTRANSPOSE, // name="viewprojectiontranspose" desc="view-projection-transpose matrix." datatypes="matrix"
93  FXS_WORLDVIEW, // desc="world-view matrix." datatypes="matrix"
94  FXS_WORLDVIEWPROJECTION, // desc="world-view-projection matrix." datatypes="matrix"
95  FXS_WORLDINVERSE, //desc="world-inverse matrix." datatypes="matrix"
96  FXS_VIEWINVERSE, // desc="view-inverse matrix." datatypes="matrix"
97  FXS_PROJECTIONINVERSE, // desc="projection-inverse matrix." datatypes="matrix"
98  FXS_WORLDINVERSETRANSPOSE, // desc="world-inverse-transpose matrix." datatypes="matrix"
99  FXS_VIEWINVERSETRANSPOSE, // desc="view-inverse-transpose matrix." datatypes="matrix"
100  FXS_PROJECTIONINVERSETRANSPOSE, // desc="projection-inverse-transpose matrix." datatypes="matrix"
101  FXS_WORLDVIEWINVERSE, // desc="world-view-inverse matrix." datatypes="matrix"
102  FXS_WORLDVIEWTRANSPOSE, // desc="world-view-transpose matrix." datatypes="matrix"
103  FXS_WORLDVIEWINVERSETRANSPOSE, // desc="world-view-inverse-transpose matrix." datatypes="matrix"
104  FXS_WORLDVIEWPROJECTIONINVERSE, // desc="world-view-projection-inverse matrix." datatypes="matrix"
106  FXS_WORLDVIEWPROJECTIONINVERSETRANSPOSE, // name="worldviewprojectioninversetranspose" desc="world-view-projection-inverse-transpose matrix." datatypes="matrix"
107  FXS_VIEWPROJECTION, // desc="view-projection matrix." datatypes="matrix"
108  FXS_VIEWPROJECTIONTRANSPOSE, // desc="view-projection-transpose matrix." datatypes="matrix"
109  FXS_VIEWPROJECTIONINVERSE, // desc="world-view-projection-inverse matrix." datatypes="matrix"
110  FXS_VIEWPROJECTIONINVERSETRANSPOSE, // desc="world-view-projection-inverse-transpose matrix." datatypes="matrix"
111  FXS_FXCOMPOSER_RESETPULSE, // desc="A pulsed boolean, reset on window resize or from the FX Composer user interface." datatypes="bool"
112  FXS_STANDARDSGLOBAL, // desc="Standards version and global annotations" datatypes="float"
113  FXS_UNITSSCALE, // desc="Defines the modeling proportions to the current unit/space." datatypes="float"
114  FXS_POWER, // Power factor
115  FXS_DIFFUSEMAP, // A diffuse texture map
116  FXS_SPECULARMAP, // A specular texture map
117  FXS_ENVMAP, // An env map
118  FXS_LIGHTPOSITION, // light position
119  FXS_TRANSFORM, // A transform
120  FXS_USER, // User Semantics - Semantics Remapper Special
127  };
128 
130  {
132  GST_ALPHABLENDENABLE, //AlphaBlendEnable
133  GST_ALPHAFUNC, //AlphaFunc
134  GST_ALPHAREF, //AlphaRef
135  GST_BLENDOP, //BlendOp
136  GST_BLENDEQUATION, //BlendEquation
137  GST_BLENDFUNC, //BlendFunc
138  GST_BLENDFUNCSEPARATE, //BlendFuncSeparate
139  GST_BLENDEQUATIONSEPARATE, //BlendEquationSeparate
140  GST_BLENDCOLOR, //BlendColor
141  GST_CLEARCOLOR, //ClearColor
142  GST_CLEARSTENCIL, //ClearStencil
143  GST_CLEARDEPTH, //ClearDepth
144  GST_CLIPPLANE, //ClipPlane
145  GST_CLIPPLANEENABLE, //ClipPlaneEnable
146  GST_COLORWRITEENABLE, //ColorWriteEnable
147  GST_COLORMASK, //ColorMask
148  GST_COLORVERTEX, //ColorVertex
149  GST_COLORMATERIAL, //ColorMaterial
150  GST_COLORMATRIX, //ColorMatrix
151  GST_COLORTRANSFORM, //ColorTransform
152  GST_CULLFACE, //CullFace
153  GST_CULLMODE, //CullMode
154  GST_DEPTHBOUNDS, //DepthBounds
155  GST_DEPTHBIAS, //DepthBias
156  GST_DESTBLEND, //DestBlend
157  GST_DEPTHFUNC, //DepthFunc
158  GST_ZFUNC, //ZFunc
159  GST_DEPTHMASK, //DepthMask
160  GST_ZWRITEENABLE, //ZWriteEnable
161  GST_DEPTHRANGE, //DepthRange
162  GST_FOGDISTANCEMODE, //FogDistanceMode
163  GST_FOGMODE, //FogMode
164  GST_FOGTABLEMODE, //FogTableMode
165  GST_INDEXEDVERTEXBLENDENABLE, //IndexedVertexBlendEnable
166  GST_FOGDENSITY, //FogDensity
167  GST_FOGSTART, //FogStart
168  GST_FOGEND, //FogEnd
169  GST_FOGCOLOR, //FogColor
170  GST_FRAGMENTENVPARAMETER, //FragmentEnvParameter
171  GST_FRAGMENTLOCALPARAMETER, //FragmentLocalParameter
172  GST_FOGCOORDSRC, //FogCoordSrc
173  GST_FOGVERTEXMODE, //FogVertexMode
174  GST_FRONTFACE, //FrontFace
175  GST_LIGHTMODELAMBIENT, //LightModelAmbient
176  GST_AMBIENT, //Ambient
177  GST_LIGHTINGENABLE, //LightingEnable
178  GST_LIGHTENABLE, //LightEnable
179  GST_LIGHTAMBIENT, //LightAmbient
180  GST_LIGHTCONSTANTATTENUATION, //LightConstantAttenuation
181  GST_LIGHTATTENUATION0, //LightAttenuation0
182  GST_LIGHTDIFFUSE, //LightDiffuse
183  GST_LIGHTLINEARATTENUATION, //LightLinearAttenuation
184  GST_LIGHTATTENUATION1, //LightAttenuation1
185  GST_LIGHTPOSITION, //LightPosition
186  GST_LIGHTQUADRATICATTENUATION, //LightQuadraticAttenuation
187  GST_LIGHTATTENUATION2, //LightAttenuation2
188  GST_LIGHTSPECULAR, //LightSpecular
189  GST_LIGHTSPOTCUTOFF, //LightSpotCutoff
190  GST_LIGHTFALLOFF, //LightFalloff
191  GST_LIGHTSPOTDIRECTION, //LightSpotDirection
192  GST_LIGHTDIRECTION, //LightDirection
193  GST_LIGHTSPOTEXPONENT, //LightSpotExponent
194  GST_LIGHTPHI, //LightPhi
195  GST_LIGHTRANGE, //LightRange
196  GST_LIGHTTHETA, //LightTheta
197  GST_LIGHTTYPE, //LightType
198  GST_LOCALVIEWER, //LocalViewer
199  GST_MULTISAMPLEANTIALIAS, //MultiSampleAntialias
200  GST_MULTISAMPLEMASK, //MultiSampleMask
201  GST_PATCHSEGMENTS, //PatchSegments
202  GST_POINTSCALE_A, //PointScale_A
203  GST_POINTSCALE_B, //PointScale_B
204  GST_POINTSCALE_C, //PointScale_C
205  GST_POINTSCALEENABLE, //PointScaleEnable
206  GST_RANGEFOGENABLE, //RangeFogEnable
207  GST_SPECULARENABLE, //SpecularEnable
208  GST_TWEENFACTOR, //TweenFactor
209  GST_VERTEXBLEND, //VertexBlend
210  GST_AMBIENTMATERIALSOURCE, //AmbientMaterialSource
211  GST_DIFFUSEMATERIALSOURCE, //DiffuseMaterialSource
212  GST_EMISSIVEMATERIALSOURCE, //EmissiveMaterialSource
213  GST_SPECULARMATERIALSOURCE, //SpecularMaterialSource
214  GST_CLIPPING, //Clipping
215  GST_LIGHTMODELCOLORCONTROL, //LightModelColorControl
216  GST_LINESTIPPLE, //LineStipple
217  GST_LINEWIDTH, //LineWidth
218  GST_LOGICOP, //LogicOp
219  GST_MATERIALAMBIENT, //MaterialAmbient
220  GST_MATERIALDIFFUSE, //MaterialDiffuse
221  GST_MATERIALEMISSION, //MaterialEmission
222  GST_MATERIALEMISSIVE, //MaterialEmissive
223  GST_MATERIALSHININESS, //MaterialShininess
224  GST_MATERIALPOWER, //MaterialPower
225  GST_MATERIALSPECULAR, //MaterialSpecular
226  GST_MODELVIEWMATRIX, //ModelViewMatrix
227  GST_MODELVIEWTRANSFORM, //ModelViewTransform
228  GST_VIEWTRANSFORM, //ViewTransform
229  GST_WORLDTRANSFORM, //WorldTransform
230  GST_POINTDISTANCEATTENUATION, //PointDistanceAttenuation
231  GST_POINTFADETHRESHOLDSIZE, //PointFadeThresholdSize
232  GST_POINTSIZE, //PointSize
233  GST_POINTSIZEMIN, //PointSizeMin
234  GST_POINTSIZEMAX, //PointSizeMax
235  GST_POINTSPRITECOORDORIGIN, //PointSpriteCoordOrigin
236  GST_POINTSPRITECOORDREPLACE, //PointSpriteCoordReplace
237  GST_POINTSPRITERMODE, //PointSpriteRMode
238  GST_POLYGONMODE, //PolygonMode
239  GST_FILLMODE, //FillMode
240  GST_LASTPIXEL, //LastPixel
241  GST_POLYGONOFFSET, //PolygonOffset
242  GST_PROJECTIONMATRIX, //ProjectionMatrix
243  GST_PROJECTIONTRANSFORM, //ProjectionTransform
244  GST_SCISSOR, //Scissor
245  GST_SHADEMODEL, //ShadeModel
246  GST_SHADEMODE, //ShadeMode
247  GST_SLOPSCALEDEPTHBIAS, //SlopScaleDepthBias
248  GST_SRCBLEND, //SrcBlend
249  GST_STENCILFUNC, //StencilFunc
250  GST_STENCILMASK, //StencilMask
251  GST_STENCILPASS, //StencilPass
252  GST_STENCILREF, //StencilRef
253  GST_STENCILWRITEMASK, //StencilWriteMask
254  GST_STENCILZFAIL, //StencilZFail
255  GST_TEXTUREFACTOR, //TextureFactor
256  GST_STENCILOP, //StencilOp
257  GST_STENCILFUNCSEPARATE, //StencilFuncSeparate
258  GST_STENCILMASKSEPARATE, //StencilMaskSeparate
259  GST_STENCILOPSEPARATE, //StencilOpSeparate
260  GST_TEXGENSMODE, //TexGenSMode
261  GST_TEXGENSOBJECTPLANE, //TexGenSObjectPlane
262  GST_TEXGENSEYEPLANE, //TexGenSEyePlane
263  GST_TEXGENTMODE, //TexGenTMode
264  GST_TEXGENTOBJECTPLANE, //TexGenTObjectPlane
265  GST_TEXGENTEYEPLANE, //TexGenTEyePlane
266  GST_TEXGENRMODE, //TexGenRMode
267  GST_TEXGENROBJECTPLANE, //TexGenRObjectPlane
268  GST_TEXGENREYEPLANE, //TexGenREyePlane
269  GST_TEXGENQMODE, //TexGenQMode
270  GST_TEXGENQOBJECTPLANE, //TexGenQObjectPlane
271  GST_TEXGENQEYEPLANE, //TexGenQEyePlane
272  GST_TEXTUREENVCOLOR, //TextureEnvColor
273  GST_TEXTUREENVMODE, //TextureEnvMode
274  GST_TEXTURE1D, //Texture1D
275  GST_TEXTURE2D, //Texture2D
276  GST_TEXTURE3D, //Texture3D
277  GST_TEXTURERECTANGLE, //TextureRectangle
278  GST_TEXTURECUBEMAP, //TextureCubeMap
279  GST_TEXTURE1DENABLE, //Texture1DEnable
280  GST_TEXTURE2DENABLE, //Texture2DEnable
281  GST_TEXTURE3DENABLE, //Texture3DEnable
282  GST_TEXTURERECTANGLEENABLE, //TextureRectangleEnable
283  GST_TEXTURECUBEMAPENABLE, //TextureCubeMapEnable
284  GST_TEXTURETRANSFORM, //TextureTransform
285  GST_TEXTUREMATRIX, //TextureMatrix
286  GST_VERTEXENVPARAMETER, //VertexEnvParameter
287  GST_VERTEXLOCALPARAMETER, //VertexLocalParameter
288  GST_ALPHATESTENABLE, //AlphaTestEnable
289  GST_AUTONORMALENABLE, //AutoNormalEnable
290  GST_BLENDENABLE, //BlendEnable
291  GST_COLORLOGICOPENABLE, //ColorLogicOpEnable
292  GST_CULLFACEENABLE, //CullFaceEnable
293  GST_DEPTHBOUNDSENABLE, //DepthBoundsEnable
294  GST_DEPTHCLAMPENABLE, //DepthClampEnable
295  GST_DEPTHTESTENABLE, //DepthTestEnable
296  GST_ZENABLE, //ZEnable
297  GST_DITHERENABLE, //DitherEnable
298  GST_FOGENABLE, //FogEnable
299  GST_LIGHTMODELLOCALVIEWERENABLE, //LightModelLocalViewerEnable
300  GST_LIGHTMODELTWOSIDEENABLE, //LightModelTwoSideEnable
301  GST_LINESMOOTHENABLE, //LineSmoothEnable
302  GST_LINESTIPPLEENABLE, //LineStippleEnable
303  GST_LOGICOPENABLE, //LogicOpEnable
304  GST_MULTISAMPLEENABLE, //MultisampleEnable
305  GST_NORMALIZEENABLE, //NormalizeEnable
306  GST_POINTSMOOTHENABLE, //PointSmoothEnable
307  GST_POINTSPRITEENABLE, //PointSpriteEnable
308  GST_POLYGONOFFSETFILLENABLE, //PolygonOffsetFillEnable
309  GST_POLYGONOFFSETLINEENABLE, //PolygonOffsetLineEnable
310  GST_POLYGONOFFSETPOINTENABLE, //PolygonOffsetPointEnable
311  GST_POLYGONSMOOTHENABLE, //PolygonSmoothEnable
312  GST_POLYGONSTIPPLEENABLE, //PolygonStippleEnable
313  GST_RESCALENORMALENABLE, //RescaleNormalEnable
314  GST_SAMPLEALPHATOCOVERAGEENABLE, //SampleAlphaToCoverageEnable
315  GST_SAMPLEALPHATOONEENABLE, //SampleAlphaToOneEnable
316  GST_SAMPLECOVERAGEENABLE, //SampleCoverageEnable
317  GST_SCISSORTESTENABLE, //ScissorTestEnable
318  GST_STENCILTESTENABLE, //StencilTestEnable
319  GST_STENCILENABLE, //StencilEnable
320  GST_STENCILTESTTWOSIDEENABLE, //StencilTestTwoSideEnable
321  GST_STENCILFAIL, //StencilFail
322  GST_TEXGENSENABLE, //TexGenSEnable
323  GST_TEXGENTENABLE, //TexGenTEnable
324  GST_TEXGENRENABLE, //TexGenREnable
325  GST_TEXGENQENABLE, //TexGenQEnable
326  GST_WRAP0, //Wrap0
327  GST_WRAP1, //Wrap1
328  GST_WRAP2, //Wrap2
329  GST_WRAP3, //Wrap3
330  GST_WRAP4, //Wrap4
331  GST_WRAP5, //Wrap5
332  GST_WRAP6, //Wrap6
333  GST_WRAP7, //Wrap7
334  GST_WRAP8, //Wrap8
335  GST_WRAP9, //Wrap9
336  GST_WRAP10, //Wrap10
337  GST_WRAP11, //Wrap11
338  GST_WRAP12, //Wrap12
339  GST_WRAP13, //Wrap13
340  GST_WRAP14, //Wrap14
341  GST_WRAP15, //Wrap15
342  GST_VERTEXPROGRAMPOINTSIZEENABLE, //VertexProgramPointSizeEnable
343  GST_VERTEXPROGRAMTWOSIDEENABLE, //VertexProgramTwoSideEnable
344  GST_GEOMETRYPROGRAM, //GeometryProgram
345  GST_VERTEXPROGRAM, //VertexProgram
346  GST_FRAGMENTPROGRAM, //FragmentProgram
347  GST_VERTEXSHADER, //VertexShader
348  GST_PIXELSHADER, //PixelShader
349  GST_ALPHAOP, //AlphaOp
350  GST_ALPHAARG0, //AlphaArg0
351  GST_ALPHAARG1, //AlphaArg1
352  GST_ALPHAARG2, //AlphaArg2
353  GST_COLORARG0, //ColorArg0
354  GST_COLORARG1, //ColorArg1
355  GST_COLORARG2, //ColorArg2
356  GST_COLOROP, //ColorOp
357  GST_BUMPENVLSCALE, //BumpEnvLScale
358  GST_BUMPENVLOFFSET, //BumpEnvLOffset
359  GST_BUMPENVMAT00, //BumpEnvMat00
360  GST_BUMPENVMAT01, //BumpEnvMat01
361  GST_BUMPENVMAT10, //BumpEnvMat10
362  GST_BUMPENVMAT11, //BumpEnvMat11
363  GST_RESULTARG, //ResultArg
364  GST_TEXCOORDINDEX, //TexCoordIndex
365  GST_TEXTURETRANSFORMFLAGS, //TextureTransformFlags
366  GST_TWOSIDEDSTENCILMODE, // TwoSidedStencilMode
367  GST_SEPARATEALPHABLENDENABLE, // SeparateAlphaBlendEnable
368  GST_NORMALIZENORMALS, // NormalizeNormals
369  GST_LIGHTING, // Lighting
370  GST_PIXELSHADERCONSTANTB, // PixelShaderConstantB
371  GST_VERTEXSHADERCONSTANTB, // VertexShaderConstantB
372  GST_COLORWRITEENABLE1, // ColorWriteEnable1
373  GST_COLORWRITEENABLE2, // ColorWriteEnable2
374  GST_COLORWRITEENABLE3, // ColorWriteEnable3
375  GST_PIXELSHADERCONSTANT1, // PixelShaderConstant1
376  GST_VERTEXSHADERCONSTANT1, // VertexShaderConstant1
377  GST_PIXELSHADERCONSTANTF, // PixelShaderConstantF
378  GST_VERTEXSHADERCONSTANTF, // VertexShaderConstantF
379  GST_PIXELSHADERCONSTANT2, // PixelShaderConstant2
380  GST_VERTEXSHADERCONSTANT2, // VertexShaderConstant2
381  GST_PIXELSHADERCONSTANT3, // PixelShaderConstant3
382  GST_VERTEXSHADERCONSTANT3, // VertexShaderConstant3
383  GST_PIXELSHADERCONSTANT, // PixelShaderConstant
384  GST_VERTEXSHADERCONSTANT, // VertexShaderConstant
385  GST_PIXELSHADERCONSTANT4, // PixelShaderConstant4
386  GST_VERTEXSHADERCONSTANT4, // VertexShaderConstant4
387  GST_PIXELSHADERCONSTANTI, // PixelShaderConstantI
388  GST_VERTEXSHADERCONSTANTI, // VertexShaderConstantI
389  GST_SAMPLER, // Sampler
390  GST_TEXTURE, // Texture
391 
392  GST_ADDRESSU, // AddressU
393  GST_ADDRESSV, // AddressV
394  GST_ADDRESSW, // AddressW
395  GST_BORDERCOLOR, // BorderColor
396  GST_MAXANISOTROPY, // MaxAnisotropy
397  GST_MAXMIPLEVEL, // MaxMipLevel
398  GST_MINFILTER, // MinFilter
399  GST_MAGFILTER, // MagFilter
400  GST_MIPFILTER, // MipFilter
401  GST_MIPMAPLODBIAS, // MipMapLodBias
402  GST_BLENDOPALPHA, // BlendOpAlpha
403  GST_SRCBLENDALPHA, // SrcBlendAlpha
404  GST_DESTBLENDALPHA, // DestBlendAlpha
405 
406 
408  };
409 #define GST_FIRST (GlobalStateType) (GST_UNKNOWN + (GlobalStateType)1)
410 
412  {
414  SST_TEXTURE, // Texture
415  SST_ADDRESSU, // AddressU
416  SST_ADDRESSV, // AddressV
417  SST_ADDRESSW, // AddressW
418  SST_WRAPS, // WrapS
419  SST_WRAPT, // WrapT
420  SST_WRAPR, // WrapR
421  SST_MIPFILTER, // MipFilter
422  SST_MIPMAPLODBIAS, // MipMapLodBias
423  SST_LODBIAS, // LODBias
424  SST_SRGBTEXTURE, // SRGBTexture
425  SST_MINFILTER, // MinFilter
426  SST_MAGFILTER, // MagFilter
427  SST_BORDERCOLOR, // BorderColor
428  SST_MINMIPLEVEL, // MinMipLevel
429  SST_MAXMIPLEVEL, // MaxMipLevel
430  SST_MAXANISOTROPY, // MaxAnisotropy
431  SST_DEPTHMODE, // DepthMode
432  SST_COMPAREMODE, // CompareMode
433  SST_COMPAREFUNC, // CompareFunc
434  SST_GENERATEMIPMAP, // GenerateMipmap
436  };
437 
438 #define SST_FIRST (SamplerStateType) (SST_UNKNOWN + (SamplerStateType)1)
439 
440  // some simple types to make working with CGstateassignment easier
441 
442  struct Vector1b
443  {
444  bool x;
445  Vector1b();
446  Vector1b( bool iX );
447  Vector1b( CGstateassignment cgStateAssignment );
448  operator bool() const;
449  };
450 
451  struct Vector2b
452  {
453  bool x, y;
454  Vector2b();
455  Vector2b( bool iX, bool iY , bool iZ, bool iW );
456  Vector2b( CGstateassignment cgStateAssignment );
457  };
458 
459  struct Vector3b
460  {
461  bool x, y, z;
462  Vector3b();
463  Vector3b( bool iX, bool iY , bool iZ, bool iW );
464  Vector3b( CGstateassignment cgStateAssignment );
465  };
466 
467  struct Vector4b
468  {
469  bool x, y, z, w;
470  Vector4b();
471  Vector4b( bool iX, bool iY , bool iZ, bool iW );
472  Vector4b( CGstateassignment cgStateAssignment );
473  };
474 
475  struct Vector1i
476  {
477  int x;
478  Vector1i();
479  Vector1i( int iX );
480  Vector1i( CGstateassignment cgStateAssignment );
481  operator int() const;
482 
483  };
484 
485  struct Vector2i
486  {
487  int x, y;
488  Vector2i();
489  Vector2i( int iX, int iY );
490  Vector2i( CGstateassignment cgStateAssignment );
491  };
492 
493  struct Vector3i
494  {
495  int x, y, z;
496  Vector3i();
497  Vector3i( int iX, int iY, int iZ );
498  Vector3i( CGstateassignment cgStateAssignment );
499  };
500 
501 
502  struct Vector4i
503  {
504  int x, y, z, w;
505  Vector4i();
506  Vector4i( int iX, int iY, int iZ, int iW );
507  Vector4i( CGstateassignment cgStateAssignment );
508  };
509 
510 
511  struct Vector1f
512  {
513  float x;
514  Vector1f();
515  Vector1f( float iX, float iY, float iZ );
516  Vector1f( CGstateassignment cgStateAssignment );
517  operator float() const;
518  };
519 
520 
521  struct Vector2f
522  {
523  float x, y;
524  Vector2f();
525  Vector2f( float iX, float iY, float iZ );
526  Vector2f( CGstateassignment cgStateAssignment );
527  };
528 
529 
530  struct Vector3f
531  {
532  float x, y, z;
533  Vector3f();
534  Vector3f( float iX, float iY, float iZ );
535  Vector3f( CGstateassignment cgStateAssignment );
536  };
537 
538  struct Vector4f
539  {
540  float x, y, z, w;
541  Vector4f();
542  Vector4f( float iX, float iY, float iZ, float iW );
543  Vector4f( CGstateassignment cgStateAssignment );
544  };
545 
546 
547 
548  // simple types end
549 
550 
552  {
553  protected:
554  CGstate mCgState;
555  CGtype mCgType;
556  CGcontext mCgContext;
557 
558  static CGbool cgCallBackSet( CGstateassignment cgStateAssignment );
559  static CGbool cgCallBackReset( CGstateassignment cgStateAssignment );
560  static CGbool cgCallBackValidate( CGstateassignment cgStateAssignment );
561 
562  virtual CGstatecallback getCgCallBackSet();
563  virtual CGstatecallback getCgCallBackReset();
564  virtual CGstatecallback getCgCallBackValidate();
565 
566  virtual void createState() = 0;
567  void addStateEnumerant( int value, const char *name );
568 
569  CGparameter getCgParameter( CGstateassignment cgStateAssignment );
570 
571 
572  public:
573  CgStateListener( CGtype cgType );
574  virtual ~CgStateListener();
575  virtual void init();
576  CGstate getCgState() const;
577  };
578 
580 
582  {
583  protected:
585  virtual void createState();
586  public:
587  CgGlobalStateListener( const GlobalStateType globalStateType, CGtype cgType );
588  virtual ~CgGlobalStateListener();
589 
590  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
591  };
594  {
595  protected:
596  const Vector1b getValue( CGstateassignment cgStateAssignment );
597  public:
598  CgBoolGlobalStateListener( const GlobalStateType globalStateType );
599  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
600  };
603  {
604  protected:
605  const Vector4b getValue( CGstateassignment cgStateAssignment );
606  public:
607  CgBool4GlobalStateListener( const GlobalStateType globalStateType );
608  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
609  };
612  {
613  protected:
614  const Vector1f getValue( CGstateassignment cgStateAssignment );
615  public:
616  CgFloatGlobalStateListener( const GlobalStateType globalStateType );
617  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
618  };
621  {
622  protected:
623  const Vector2f getValue( CGstateassignment cgStateAssignment );
624  public:
625  CgFloat2GlobalStateListener( const GlobalStateType globalStateType );
626  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
627  };
630  {
631  protected:
632  const Vector3f getValue( CGstateassignment cgStateAssignment );
633  public:
634  CgFloat3GlobalStateListener( const GlobalStateType globalStateType );
635  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
636  };
639  {
640  protected:
641  const Vector4f getValue( CGstateassignment cgStateAssignment );
642  public:
643  CgFloat4GlobalStateListener( const GlobalStateType globalStateType );
644  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
645  };
648  {
649  public:
650  CgFloat4x2GlobalStateListener( const GlobalStateType globalStateType );
651  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
652  };
655  {
656  public:
657  CgFloat4x3GlobalStateListener( const GlobalStateType globalStateType );
658  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
659  };
662  {
663  public:
664  CgFloat4x4GlobalStateListener( const GlobalStateType globalStateType );
665  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
666  };
669  {
670  protected:
671  const Vector1i getValue( CGstateassignment cgStateAssignment );
672  public:
673  CgIntGlobalStateListener( const GlobalStateType globalStateType );
674  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
675  };
678  {
679  protected:
680  const Vector2i getValue( CGstateassignment cgStateAssignment );
681  public:
682  CgInt2GlobalStateListener( const GlobalStateType globalStateType );
683  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
684  };
687  {
688  protected:
689  const Vector3i getValue( CGstateassignment cgStateAssignment );
690  public:
691  CgInt3GlobalStateListener( const GlobalStateType globalStateType );
692  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
693  };
696  {
697  protected:
698  const Vector4i getValue( CGstateassignment cgStateAssignment );
699  public:
700  CgInt4GlobalStateListener( const GlobalStateType globalStateType );
701  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
702  };
705  {
706  public:
707  CgSamplerGlobalStateListener( const GlobalStateType globalStateType );
708  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
709  };
712  {
713  public:
714  CgSampler2GlobalStateListener( const GlobalStateType globalStateType );
715  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
716  };
719  {
720  public:
721  CgSampler3GlobalStateListener( const GlobalStateType globalStateType );
722  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
723  };
726  {
727  public:
728  CgSamplerCubeGlobalStateListener( const GlobalStateType globalStateType );
729  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
730  };
733  {
734  public:
735  CgSamplerRectGlobalStateListener( const GlobalStateType globalStateType );
736  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
737  };
740  {
741  public:
742  CgTextureGlobalStateListener( const GlobalStateType globalStateType );
743  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
744  };
747  {
748  public:
749  CgProgramGlobalStateListener( const GlobalStateType globalStateType );
750  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
751  };
752 
755  {
756  protected:
758  {
759  BET_FUNCADD, // FuncAdd
760  BET_FUNCSUBTRACT, // FuncSubtract
761  BET_MIN, // Min
762  BET_MAX, // Max
763  BET_LOGICOP // LogicOp
764  };
765  virtual void createState();
766  public:
768  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
769  };
772  {
773  protected:
775  {
776  DFT_NEVER, // Never
777  DFT_LESS, // Less
778  DFT_LEQUAL, // LEqual
779  DFT_EQUAL, // Equal
780  DFT_GREATER, // Greater
781  DFT_NOTEQUAL, // NotEqual
782  DFT_GEQUAL, // GEqual
783  DFT_ALWAYS // Always
784  };
785  virtual void createState();
786  public:
788  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
789  };
792  {
793  protected:
795  {
796  FDMT_EYERADIAL, // EyeRadial
797  FDMT_EYEPLANE, // EyePlane
798  FDMT_EYEPLANEABSOLUTE // EyePlaneAbsolute
799  };
800  virtual void createState();
801  public:
803  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
804  };
807  {
808  protected:
810  {
811  FMT_LINEAR, // Linear
812  FMT_EXP, // Exp
813  FMT_EXP2 // Exp2
814  };
815  virtual void createState();
816  public:
818  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
819  };
820 
823  {
824  protected:
826  {
827  LMCCT_SINGLECOLOR, // SingleColor
828  LMCCT_SEPARATESPECULAR // SeparateSpecular
829  };
830  virtual void createState();
831  public:
833  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
834  };
837  {
838  protected:
840  {
841  LOT_CLEAR, // Clear
842  LOT_AND, // And
843  LOT_ANDREVERSE, // AndReverse
844  LOT_COPY, // Copy
845  LOT_ANDINVERTED, // AndInverted
846  LOT_NOOP, // Noop
847  LOT_XOR, // Xor
848  LOT_OR, // Or,
849  LOT_NOR, // Nor
850  LOT_EQUIV, // Equiv
851  LOT_INVERT, // Invert
852  LOT_ORREVERSE, // OrReverse
853  LOT_COPYINVERTED, // CopyInverted
854  LOT_NAND, // Nand
855  LOT_SET // Set
856  };
857  virtual void createState();
858  public:
860  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
861  };
864  {
865  protected:
867  {
868  PSCOT_LOWERLEFT, // LowerLeft
869  PSCOT_UPPERLEFT // UpperLeft
870  };
871  virtual void createState();
872  public:
874  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
875  };
878  {
879  protected:
881  {
882  PSRMT_ZERO, // Zero
883  PSRMT_R, // R
884  PSRMT_S // S
885  };
886  virtual void createState();
887  public:
889  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
890  };
893  {
894  protected:
896  {
897  SMT_FLAT, // Flat
898  SMT_SMOOTH // Smooth
899  };
900  virtual void createState();
901  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
902  public:
904  };
907  {
908  protected:
910  {
911  TGMT_OBJECTLINEAR, // ObjectLinear
912  TGMT_EYELINEAR, // EyeLinear
913  TGMT_SPHEREMAP, // SphereMap
914  TGMT_REFLECTIONMAP, // ReflectionMap
915  TGMT_NORMALMAP // NormalMap
916  };
917  virtual void createState();
918  public:
919  CgTexGenModeGlobalStateListener( const GlobalStateType globalStateType );
920  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
921  };
924  {
925  protected:
927  {
928  BET_MODULATE, // Modulate
929  BET_DECAL, // Decal
930  BET_BLEND, // Blend
931  BET_REPLACE, // Replace
932  BET_ADD // Add
933  };
934  virtual void createState();
935  public:
937  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
938  };
941  {
942  protected:
944  {
945  MFT_NEAREST, // Nearest
946  MFT_LINEAR, // Linear
947  MFT_LINEARMIPMAPNEAREST, // LinearMipMapNearest
948  MFT_NEARESTMIPMAPNEAREST, // NearestMipMapNearest
949  MFT_NEARESTMIPMAPLINEAR, // NearestMipMapLinear
950  MFT_LINEARMIPMAPLINEAR // LinearMipMapLinear
951  };
952  virtual void createState();
953  public:
955  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
956  };
959  {
960  protected:
962  {
963  MFT_NEAREST, // Nearest
964  MFT_LINEAR // Linear
965  };
966  virtual void createState();
967  public:
969  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
970  };
973  {
974  protected:
976  {
977  FFT_CW, // CW
978  FFT_CCW // CCW
979  };
980  virtual void createState();
981  public:
983  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
984  };
987  {
988  protected:
990  {
991  CFT_FRONT, // Front
992  CFT_BACK, // Back
993  CFT_FRONTANDBACK // FrontAndBack
994  };
995  virtual void createState();
996  public:
998  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
999  };
1002  {
1003  protected:
1005  {
1006  FCST_FRAGMENTDEPTH, // FragmentDepth
1007  FCST_FOGCOORD // FogCoord
1008  };
1009  virtual void createState();
1010  public:
1012  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
1013  };
1014 
1015  // AlphaFuncGlobal - float2 - reference then value
1017  {
1018  protected:
1020  {
1021  AFT_NEVER, // Never
1022  AFT_LESS, // Less
1023  AFT_LEQUAL, // LEqual
1024  AFT_EQUAL, // Equal
1025  AFT_GREATER, // Greater
1026  AFT_NOTEQUAL, // NotEqual
1027  AFT_GEQUAL, // GEqual
1028  AFT_ALWAYS // Always
1029  };
1030  virtual void createState();
1031  public:
1033  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
1034  };
1035 
1036  // BlendFuncGlobal - Int2 - src_factor, dst_factor
1038  {
1039  protected:
1041  {
1042  BF_ZERO, // Zero
1043  BF_ONE, // One
1044  BF_DESTCOLOR, // DestColor
1045  BF_ONEMINUSDESTCOLOR, // OneMinusDestColor
1046  BF_SRCALPHA, // SrcAlpha
1047  BF_ONEMINUSSRCALPHA, // OneMinusSrcAlpha
1048  BF_DSTALPHA, // DstAlpha
1049  BF_ONEMINUSDSTALPHA, // OneMinusDstAlpha
1050  BF_SRCALPHASATURATE, // SrcAlphaSaturate
1051  BF_SRCCOLOR, // SrcColor
1052  BF_ONEMINUSSRCCOLOR, // OneMinusSrcColor
1053  BF_CONSTANTCOLOR, // ConstantColor
1054  BF_ONEMINUSCONSTANTCOLOR, // OneMinusConstantColor
1055  BF_CONSTANTALPHA, // ConstantAlpha
1056  BF_ONEMINUSCONSTANTALPHA // OneMinusConstantAlpha
1057  };
1058  virtual void createState();
1059  public:
1061  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
1062  };
1063 
1064 
1065  // BlendFuncSeparate - int4 (rgb_src, rgb_dst, a_src, a_dst)
1067  {
1068  protected:
1070  {
1071  BFST_ZERO, // Zero
1072  BFST_ONE, // One
1073  BFST_DESTCOLOR, // DestColor
1074  BFST_ONEMINUSDESTCOLOR, // OneMinusDestColor
1075  BFST_SRCALPHA, // SrcAlpha
1076  BFST_ONEMINUSSRCALPHA, // OneMinusSrcAlpha
1077  BFST_DSTALPHA, // DstAlpha
1078  BFST_ONEMINUSDSTALPHA, // OneMinusDstAlpha
1079  BFST_SRCALPHASATURATE, // SrcAlphaSaturate
1080  BFST_SRCCOLOR, // SrcColor
1081  BFST_ONEMINUSSRCCOLOR, // OneMinusSrcColor
1082  BFST_CONSTANTCOLOR, // ConstantColor
1083  BFST_ONEMINUSCONSTANTCOLOR, // OneMinusConstantColor
1084  BFST_CONSTANTALPHA, // ConstantAlpha
1085  BFST_ONEMINUSCONSTANTALPHA // OneMinusConstantAlpha
1086  };
1087  virtual void createState();
1088  public:
1090  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
1091  };
1092 
1093  // BlendEquationSeparate - int2 (rgb,alpha)
1095  {
1096  protected:
1098  {
1099  BEST_FUNCADD, // FuncAdd
1100  BEST_FUNCSUBTRACT, // FuncSubtract
1101  BEST_MIN, // Min
1102  BEST_MAX, // Max
1103  BEST_LOGICOP // LogicOp
1104  };
1105  virtual void createState();
1106  public:
1108  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
1109  };
1110 
1111 
1112  // int2
1114  {
1115  protected:
1117  {
1118  CMT_FRONT, // Front
1119  CMT_BACK, // Back
1120  CMT_FRONTANDBACK, // FrontAndBack
1121  CMT_EMISSION, // Emission
1122  CMT_AMBIENT, // Ambient
1123  CMT_DIFFUSE, // Diffuse
1124  CMT_SPECULAR, // Specular
1125  CMT_AMBIENTANDDIFFUSE // AmbientAndDiffuse
1126  };
1127  virtual void createState();
1128  public:
1130  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
1131  };
1132 
1133  // int2
1135  {
1136  protected:
1138  {
1139  PMT_FRONT, // Front
1140  PMT_BACK, // Back
1141  PMT_FRONTANDBACK, // FrontAndBack
1142  PMT_POINT, // Point
1143  PMT_LINE, // Line
1144  PMT_FILL // Fill
1145  };
1146  virtual void createState();
1147  public:
1149  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
1150  };
1151 
1152  // int3
1154  {
1155  protected:
1157  {
1158  SFT_NEVER, // Never
1159  SFT_LESS, // Less
1160  SFT_LEQUAL, // LEqual
1161  SFT_EQUAL, // Equal
1162  SFT_GREATER, // Greater
1163  SFT_NOTEQUAL, // NotEqual
1164  SFT_GEQUAL, // GEqual
1165  SFT_ALWAYS // Always
1166  };
1167  virtual void createState();
1168  public:
1170  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
1171  };
1172 
1173  // int3
1175  {
1176  protected:
1178  {
1179  SOT_KEEP, // Keep
1180  SOT_ZERO, // Zero
1181  SOT_REPLACE, // Replace
1182  SOT_INCR, // Incr
1183  SOT_DECR, // Decr
1184  SOT_INVERT, // Invert
1185  SOT_INCRWRAP, // IncrWrap
1186  SOT_DECRWRAP // DecrWrap
1187  };
1188  virtual void createState();
1189  public:
1191  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
1192  };
1193 
1194  // int4
1196  {
1197  protected:
1199  {
1200  SFST_FRONT, // Front
1201  SFST_BACK, // Back
1202  SFST_FRONTANDBACK, // FrontAndBack
1203  SFST_NEVER, // Never
1204  SFST_LESS, // Less
1205  SFST_LEQUAL, // LEqual
1206  SFST_EQUAL, // Equal
1207  SFST_GREATER, // Greater
1208  SFST_NOTEQUAL, // NotEqual
1209  SFST_GEQUAL, // GEqual
1210  SFST_ALWAYS // Always
1211  };
1212  virtual void createState();
1213  public:
1215  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
1216  };
1217 
1218  // int2
1220  {
1221  protected:
1223  {
1224  BET_FRONT, // Front
1225  BET_BACK, // Back
1226  BET_FRONTANDBACK // FrontAndBack
1227  };
1228  virtual void createState();
1229  public:
1231  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
1232  };
1233 
1234  // int4
1236  {
1237  protected:
1239  {
1240  BET_KEEP, // Keep
1241  BET_ZERO, // Zero
1242  BET_REPLACE, // Replace
1243  BET_INCR, // Incr
1244  BET_DECR, // Decr
1245  BET_INVERT, // Invert
1246  BET_INCRWRAP, // IncrWrap
1247  BET_DECRWRAP // DecrWrap
1248  };
1249  virtual void createState();
1250  public:
1252  virtual void updatePass( Pass * ogrePass, CGstateassignment cgStateAssignment );
1253  };
1254 
1255 
1257  {
1258  protected:
1260  virtual void createState();
1261  public:
1262  CgSamplerStateListener( const SamplerStateType samplerStateType, CGtype cgType );
1263  virtual ~CgSamplerStateListener();
1264 
1265  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1266  };
1269  {
1270  protected:
1271  const Vector1i getValue( CGstateassignment cgStateAssignment );
1272  public:
1273  CgIntSamplerStateListener( const SamplerStateType samplerStateType );
1274  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1275  };
1278  {
1279  public:
1280  CgBoolSamplerStateListener( const SamplerStateType samplerStateType );
1281  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1282  };
1285  {
1286  public:
1287  CgFloatSamplerStateListener( const SamplerStateType samplerStateType );
1288  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1289  };
1292  {
1293  public:
1294  CgFloat4SamplerStateListener( const SamplerStateType samplerStateType );
1295  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1296  };
1299  {
1300  protected:
1301  TextureType parseTextureType( CGparameter cgParameter, TextureUnitState * ogreTextureUnitState );
1302  void parseTextureName( CGparameter cgParameter, TextureUnitState * ogreTextureUnitState );
1303  public:
1304  CgTextureSamplerStateListener(const SamplerStateType samplerStateType);
1305  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1306 
1307  };
1308 
1309  // Wrap = TextureAddressingMode
1311  {
1312  protected:
1314  {
1315  WT_REPEAT, // Repeat
1316  WT_CLAMP, // Clamp
1317  WT_CLAMPTOEDGE, // ClampToEdge
1318  WT_CLAMPTOBORDER, // ClampToBorder
1319  WT_MIRROREDREPEAT, // MirroredRepeat
1320  WT_MIRRORCLAMP, // MirrorClamp
1321  WT_MIRRORCLAMPTOEDGE, // MirrorClampToEdge
1322  WT_MIRRORCLAMPTOBORDER // MirrorClampToBorder
1323  };
1324  virtual void createState();
1325  TextureUnitState::TextureAddressingMode getOgreTextureAddressingMode( CGstateassignment cgStateAssignment );
1326  public:
1327  CgWrapSamplerStateListener(const SamplerStateType samplerStateType);
1328  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1329  };
1332  {
1333  protected:
1335  {
1336  CMT_NONE, // None
1337  CMT_COMPARERTOTEXTURE // CompareRToTexture
1338  };
1339  virtual void createState();
1340  public:
1342  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1343  };
1346  {
1347  protected:
1349  {
1350  CFT_NEVER, // Never
1351  CFT_LESS, // Less
1352  CFT_LEQUAL, // LEqual
1353  CFT_EQUAL, // Equal
1354  CFT_GREATER, // Greater
1355  CFT_NOTEQUAL // NotEqual
1356  };
1357  virtual void createState();
1358  public:
1360  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1361  };
1364  {
1365  protected:
1367  {
1368  DMT_ALPHA, // Alpha
1369  DMT_INTENSITY, // Intensity
1370  DMT_LUMINANCE // Luminance
1371  };
1372  virtual void createState();
1373  public:
1375  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1376  };
1379  {
1380  protected:
1382  {
1383  MINFT_NEAREST, // Nearest
1384  MINFT_LINEAR, // Linear
1385  MINFT_LINEARMIPMAPNEAREST, // LinearMipMapNearest
1386  MINFT_NEARESTMIPMAPNEAREST, // NearestMipMapNearest
1387  MINFT_NEARESTMIPMAPLINEAR, // NearestMipMapLinear
1388  MINFT_LINEARMIPMAPLINEAR // LinearMipMapLinear
1389  };
1390 
1391  virtual void createState();
1392  public:
1394  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1395  };
1398  {
1399  protected:
1401  {
1402  MAGFT_NEAREST, // Nearest
1403  MAGFT_LINEAR // Linear
1404 
1405  };
1406 
1407  virtual void createState();
1408  public:
1410  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1411  };
1414  {
1415  protected:
1417  {
1418  MIPFT_NONE = 0, // filtering disabled (valid for mip filter only)
1419  MIPFT_POINT = 1, // nearest
1420  MIPFT_LINEAR = 2, // linear interpolation
1421  MIPFT_ANISOTROPIC = 3, // anisotropic
1422  MIPFT_PYRAMIDALQUAD = 6, // 4-sample tent
1423  MIPFT_GAUSSIANQUAD = 7 // 4-sample gaussian
1424 
1425  };
1426 
1427  virtual void createState();
1428  public:
1430  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1431  };
1434  {
1435  protected:
1437  {
1438  TAT_WRAP = 1, // Wrap
1439  TAT_MIRROR, // Mirror
1440  TAT_CLAMP, // Clamp
1441  TAT_BORDER, // Border
1442  TAT_MIRRORONCE // MirrorOnce
1443  };
1444 
1445  virtual void createState();
1446  public:
1447  CgTextureAddressSamplerStateListener( const SamplerStateType samplerStateType );
1448  virtual void upateTextureUnitState( TextureUnitState * ogreTextureUnitState, CGstateassignment cgStateAssignment );
1449  };
1450 
1453 
1458 
1459  StringVector mScriptPatterns; // for getScriptPatterns(void)
1460 
1461  CGcontext mCgContext;
1462  CGcontext getCgContext() const;
1463 
1464 
1465  void parseCgEffect( CGeffect cgEffect, MaterialPtr ogreMaterial );
1466  void parseCgEffectTechniques( CGeffect cgEffect, MaterialPtr ogreMaterial );
1467  void parseCgTechnique( CGtechnique cgTechnique, Technique * ogreTechnique );
1468  void parseCgPass( CGpass cgPass, Pass * ogrePass );
1469  void parseSamplerParameters(CGpass cgPass, Pass * ogrePass);
1470 
1471  void parsePassStateAssignments( CGpass cgPass, Pass * ogrePass );
1472  void parseCgProgram( CGpass cgPass, Pass * ogrePass, const GpuProgramType ogreProgramType );
1473  void parseCgProgramParameters( CGpass cgPass, GpuProgramParametersSharedPtr ogreProgramParameters );
1474  void parseCgProgramParameter( CGparameter cgParameter, GpuProgramParametersSharedPtr ogreProgramParameters, const String& ogreParamName );
1475  void parseTextureUnitState( CGstateassignment cgStateAssignment, TextureUnitState * ogreTextureUnitState );
1476 
1477  void parseFloatCgProgramParameter( CGtype cgParamType, CGparameter cgParameter, GpuProgramParametersSharedPtr ogreProgramParameters, const String& ogreParamName );
1478  void parseIntCgProgramParameter( CGtype cgParamType, CGparameter cgParameter, GpuProgramParametersSharedPtr ogreProgramParameters, const String& ogreParamName );
1479  bool parseAutoConstantParam( CGparameter cgParameter, GpuProgramParametersSharedPtr ogreProgramParameters, const String& ogreParamName );
1480  bool cgSemanticToOgreAutoConstantType( const char * cgParamSemantic, const char * uiNameValue, GpuProgramParameters::AutoConstantType & ogreAutoConstantType, size_t & extraInfo );
1481  FXSemanticID cgSemanticStringToType( const char * cgParamSemantic );
1482 
1484 
1485  const char * getGlobalStateNameTypeToString( const GlobalStateType cgStateName );
1486  const char * getSamplerStateNameTypeToString( const SamplerStateType cgStateName );
1489 
1490  public:
1491  CgFxScriptLoader();
1492  virtual ~CgFxScriptLoader();
1493 
1495  const StringVector& getScriptPatterns(void) const;
1497  void parseScript( DataStreamPtr& stream, const String& groupName );
1498 
1500  Real getLoadingOrder(void) const;
1501 
1517  static CgFxScriptLoader& getSingleton(void);
1533  static CgFxScriptLoader* getSingletonPtr(void);
1534  private:
1535 
1536  };
1537 
1538 } // namespace Ogre
1539 
1540 #endif
CgSamplerCubeGlobalStateListener(const GlobalStateType globalStateType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
const Vector1i getValue(CGstateassignment cgStateAssignment)
CgStateListenerVector mCgStateListenerVector
CgSampler3GlobalStateListener(const GlobalStateType globalStateType)
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
CgFloat4x4GlobalStateListener(const GlobalStateType globalStateType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
float Real
Software floating point type.
CgStateListenerVector mCgSamplerStateListenerVector
const Vector2f getValue(CGstateassignment cgStateAssignment)
void parseTextureUnitState(CGstateassignment cgStateAssignment, TextureUnitState *ogreTextureUnitState)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
CgSamplerStateToListenerMap mCgSamplerStateToListenerMap
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
CgBoolSamplerStateListener(const SamplerStateType samplerStateType)
const Vector4f getValue(CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
const Vector3f getValue(CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
CgProgramGlobalStateListener(const GlobalStateType globalStateType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
CgGlobalStateListener * createCgGlobalStateListener(const GlobalStateType type)
CgBoolGlobalStateListener(const GlobalStateType globalStateType)
vector< CgStateListener * >::type CgStateListenerVector
CgInt2GlobalStateListener(const GlobalStateType globalStateType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
Template class for creating single-instance global classes.
Definition: OgreSingleton.h:64
CgIntGlobalStateListener(const GlobalStateType globalStateType)
const Vector3i getValue(CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
const char * getSamplerStateNameTypeToString(const SamplerStateType cgStateName)
void parsePassStateAssignments(CGpass cgPass, Pass *ogrePass)
GpuProgramType
Enumerates the types of programs which can run on the GPU.
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
CgSamplerGlobalStateListener(const GlobalStateType globalStateType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
const Vector4i getValue(CGstateassignment cgStateAssignment)
virtual CGstatecallback getCgCallBackReset()
virtual CGstatecallback getCgCallBackValidate()
CgIntSamplerStateListener(const SamplerStateType samplerStateType)
void parseCgEffect(CGeffect cgEffect, MaterialPtr ogreMaterial)
Real getLoadingOrder(void) const
Gets the relative loading order of scripts of this type.
CgBool4GlobalStateListener(const GlobalStateType globalStateType)
static CGbool cgCallBackValidate(CGstateassignment cgStateAssignment)
const char * getGlobalStateNameTypeToString(const GlobalStateType cgStateName)
void parseCgPass(CGpass cgPass, Pass *ogrePass)
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
CgTextureAddressSamplerStateListener(const SamplerStateType samplerStateType)
CGcontext getCgContext() const
CgFloat4SamplerStateListener(const SamplerStateType samplerStateType)
bool parseAutoConstantParam(CGparameter cgParameter, GpuProgramParametersSharedPtr ogreProgramParameters, const String &ogreParamName)
Class representing an approach to rendering this particular Material.
Definition: OgreTechnique.h:50
CgSamplerRectGlobalStateListener(const GlobalStateType globalStateType)
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
void parseIntCgProgramParameter(CGtype cgParamType, CGparameter cgParameter, GpuProgramParametersSharedPtr ogreProgramParameters, const String &ogreParamName)
CgTextureSamplerStateListener(const SamplerStateType samplerStateType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
void parseCgTechnique(CGtechnique cgTechnique, Technique *ogreTechnique)
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
map< CGstate, CgGlobalStateListener * >::type CgGlobalStateToListenerMap
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
Class defining a single pass of a Technique (of a Material), i.e.
Definition: OgrePass.h:78
CgFloat3GlobalStateListener(const GlobalStateType globalStateType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
const Vector2i getValue(CGstateassignment cgStateAssignment)
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
static CgFxScriptLoader * getSingletonPtr(void)
Override standard Singleton retrieval.
const Vector1f getValue(CGstateassignment cgStateAssignment)
bool cgSemanticToOgreAutoConstantType(const char *cgParamSemantic, const char *uiNameValue, GpuProgramParameters::AutoConstantType &ogreAutoConstantType, size_t &extraInfo)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
AutoConstantType
Defines the types of automatically updated values that may be bound to GpuProgram parameters...
void parseSamplerParameters(CGpass cgPass, Pass *ogrePass)
void buildStateNameStringToTypeMap()
Abstract class defining the interface used by classes which wish to perform script loading to define ...
void parseCgEffectTechniques(CGeffect cgEffect, MaterialPtr ogreMaterial)
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
const StringVector & getScriptPatterns(void) const
Gets the file patterns which should be used to find scripts for this class.
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
TextureType parseTextureType(CGparameter cgParameter, TextureUnitState *ogreTextureUnitState)
CgTextureGlobalStateListener(const GlobalStateType globalStateType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
FXSemanticID
We want to comply to FXCompositor - this list is the enum FXComposer.Core.FXSemanticID that existing ...
void parseCgProgramParameters(CGpass cgPass, GpuProgramParametersSharedPtr ogreProgramParameters)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
CgFloatGlobalStateListener(const GlobalStateType globalStateType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
TextureAddressingMode
Texture addressing modes - default is TAM_WRAP.
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
void parseTextureName(CGparameter cgParameter, TextureUnitState *ogreTextureUnitState)
void parseScript(DataStreamPtr &stream, const String &groupName)
Parse a script file.
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
vector< String >::type StringVector
void parseFloatCgProgramParameter(CGtype cgParamType, CGparameter cgParameter, GpuProgramParametersSharedPtr ogreProgramParameters, const String &ogreParamName)
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
static CGbool cgCallBackSet(CGstateassignment cgStateAssignment)
void parseCgProgram(CGpass cgPass, Pass *ogrePass, const GpuProgramType ogreProgramType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
TextureUnitState::TextureAddressingMode getOgreTextureAddressingMode(CGstateassignment cgStateAssignment)
const Vector1b getValue(CGstateassignment cgStateAssignment)
FXSemanticID cgSemanticStringToType(const char *cgParamSemantic)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
CgFloat4GlobalStateListener(const GlobalStateType globalStateType)
CgSamplerStateListener * createCgSamplerStateListener(const SamplerStateType type)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
CGparameter getCgParameter(CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
CgInt4GlobalStateListener(const GlobalStateType globalStateType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
static CGbool cgCallBackReset(CGstateassignment cgStateAssignment)
TextureType
Enum identifying the texture type.
Definition: OgreTexture.h:76
CgGlobalStateListener(const GlobalStateType globalStateType, CGtype cgType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
CgInt3GlobalStateListener(const GlobalStateType globalStateType)
virtual void upateTextureUnitState(TextureUnitState *ogreTextureUnitState, CGstateassignment cgStateAssignment)
Manages Overlay objects, parsing them from .overlay files and storing a lookup library of them...
CgSamplerStateListener(const SamplerStateType samplerStateType, CGtype cgType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
_StringBase String
Definition: OgreCommon.h:53
virtual CGstatecallback getCgCallBackSet()
const Vector1i getValue(CGstateassignment cgStateAssignment)
CgWrapSamplerStateListener(const SamplerStateType samplerStateType)
map< CGstate, CgSamplerStateListener * >::type CgSamplerStateToListenerMap
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
CgFloatSamplerStateListener(const SamplerStateType samplerStateType)
CgFloat2GlobalStateListener(const GlobalStateType globalStateType)
void parseCgProgramParameter(CGparameter cgParameter, GpuProgramParametersSharedPtr ogreProgramParameters, const String &ogreParamName)
Class representing the state of a single texture unit during a Pass of a Technique, of a Material.
static CgFxScriptLoader & getSingleton(void)
Override standard Singleton retrieval.
CgFloat4x3GlobalStateListener(const GlobalStateType globalStateType)
void addStateEnumerant(int value, const char *name)
CgTexGenModeGlobalStateListener(const GlobalStateType globalStateType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
CgGlobalStateToListenerMap mCgGlobalStateToListenerMap
const Vector4b getValue(CGstateassignment cgStateAssignment)
CgSampler2GlobalStateListener(const GlobalStateType globalStateType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)
CgFloat4x2GlobalStateListener(const GlobalStateType globalStateType)
virtual void updatePass(Pass *ogrePass, CGstateassignment cgStateAssignment)