OGRE  1.7
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Direct3D10/include/OgreFixedFuncState.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-2011 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 __FixedFuncState_H__
29 #define __FixedFuncState_H__
30 
31 #include "OgrePrerequisites.h"
32 #include "OgreGpuProgram.h"
33 #include "OgreColourValue.h"
34 #include "OgreBlendMode.h"
35 #include "OgreCommon.h"
36 #include "OgreLight.h"
37 #include "OgreTextureUnitState.h"
38 #include "OgreRenderSystem.h"
39 
40 namespace Ogre {
41 
42 
44  {
45  protected:
50  public:
54  void setTextureType(TextureType val);
59  uint8 getCoordIndex() const;
60  void setCoordIndex(uint8 val);
61  };
62 
64 
66  {
67  protected:
70  unsigned short mVertexElementIndex;
71  public:
76  unsigned short getVertexElementIndex() const;
77  void setVertexElementIndex(unsigned short val);
78  };
79 
81 
83  {
84  protected:
86  public:
91 
92  const bool operator<(const VertexBufferDeclaration & other) const;
93 
94  bool hasColor() const;
95  uint8 getTexcoordCount() const;
96  unsigned short numberOfTexcoord() const;
97  unsigned short countVertexElementSemantic( VertexElementSemantic semantic ) const;
98 
99  };
100 
101  class GeneralFixedFuncState // this is a class of the "global parameters" so I can use memcmp on them
102  {
103  protected:
106  //-------------------------------------------------------------------------
107  // Alpha reject settings
109  //-------------------------------------------------------------------------
110  // Fog
112  //-------------------------------------------------------------------------
115 
116 #define LIGHT_TYPES_COUNT Light::LT_SPOTLIGHT + 1 // better to update the LightTypes enum
117  // a counter for each of the light types
121  public:
125 
134  void setLightingEnabled(bool enabled);
135 
138  bool getLightingEnabled(void) const;
139 
144  void setShadingMode( ShadeOptions mode );
145 
148  ShadeOptions getShadingMode(void) const;
149 
179  void setFogMode( FogMode mode );
180 
185  FogMode getFogMode(void) const;
186 
190 
194 
195 
207  void setNormaliseNormals(bool normalise);
208 
210  bool getNormaliseNormals(void) const;
211 
212  const uint8 getLightTypeCount(const Light::LightTypes type) const;
213  void setLightTypeCount(const Light::LightTypes type, const uint8 val);
214  const uint8 getTotalNumberOfLights() const;
215  void resetLightTypeCounts();
216  void addOnetoLightTypeCount(const Light::LightTypes type);
217 
218  };
219 
234  {
235  public:
236  protected:
238  //-------------------------------------------------------------------------
241  //-------------------------------------------------------------------------
242  public:
244  FixedFuncState();
245  ~FixedFuncState();
246 
250 
251  const bool operator<(const FixedFuncState & other) const;
252 
253  };
254 
255 }
256 
257 #endif
unsigned char uint8
Definition: OgrePlatform.h:248
const bool operator<(const FixedFuncState &other) const
const TextureLayerStateList & getTextureLayerStateList() const
void setVertexBufferElementList(const VertexBufferElementList &val)
FogMode
Fog modes.
Definition: OgreCommon.h:122
const bool operator<(const VertexBufferDeclaration &other) const
void addOnetoLightTypeCount(const Light::LightTypes type)
vector< TextureLayerState >::type TextureLayerStateList
TextureLayerStateList mTextureLayerStateList
Storage of texture layer states.
LightTypes
Defines the type of light.
Definition: OgreLight.h:81
void setLightingEnabled(bool enabled)
Sets whether or not dynamic lighting is enabled.
GeneralFixedFuncState & getGeneralFixedFuncState()
TexCoordCalcMethod
Enum describing the ways to generate texture coordinates.
FogMode getFogMode(void) const
Returns the fog mode for this pass.
unsigned short numberOfTexcoord() const
unsigned short getVertexElementIndex() const
VertexElementSemantic
Vertex element semantics, used to identify the meaning of vertex buffer contents. ...
FixedFuncState()
Default constructor.
const uint8 getLightTypeCount(const Light::LightTypes type) const
const uint8 getTotalNumberOfLights() const
void setLayerBlendModeEx(LayerBlendModeEx val)
VertexElementType getVertexElementType() const
void setLightTypeCount(const Light::LightTypes type, const uint8 val)
void setVertexElementIndex(unsigned short val)
ShadeOptions
Light shading modes.
Definition: OgreCommon.h:114
void setVertexElementSemantic(VertexElementSemantic val)
void setTexCoordCalcMethod(TexCoordCalcMethod val)
vector< VertexBufferElement >::type VertexBufferElementList
Class defining a fixed function state.
const VertexBufferElementList & getVertexBufferElementList() const
TextureType getTextureType() const
void setVertexElementType(VertexElementType val)
void setTextureType(TextureType val)
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
uint8 getCoordIndex() const
void setShadingMode(ShadeOptions mode)
Sets the type of light shading required.
VertexElementSemantic getVertexElementSemantic() const
ShadeOptions getShadingMode(void) const
Returns the type of light shading to be used.
void setFogMode(FogMode mode)
Sets the fogging mode applied to this pass.
unsigned short countVertexElementSemantic(VertexElementSemantic semantic) const
TextureType
Enum identifying the texture type.
Definition: OgreTexture.h:67
void setTextureLayerStateList(const TextureLayerStateList &val)
void setNormaliseNormals(bool normalise)
If set to true, this forces normals to be normalised dynamically by the hardware for this pass...
TexCoordCalcMethod getTexCoordCalcMethod() const
GeneralFixedFuncState()
Default constructor.
void setCoordIndex(uint8 val)
void setAlphaRejectFunction(CompareFunction func)
Sets the alpha reject function.
CompareFunction getAlphaRejectFunction(void) const
Gets the alpha reject function.
bool getLightingEnabled(void) const
Returns whether or not dynamic lighting is enabled.
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
Definition: OgreCommon.h:65
Class which manages blending of both colour and alpha components.
LayerBlendModeEx getLayerBlendModeEx() const
bool getNormaliseNormals(void) const
Returns true if this pass has auto-normalisation of normals set.