11 #ifndef CAFU_MATSYS_OPENGLSTATE_HPP_INCLUDED
12 #define CAFU_MATSYS_OPENGLSTATE_HPP_INCLUDED
15 #if defined(_WIN32) && defined(_MSC_VER)
16 #define WIN32_LEAN_AND_MEAN
33 void ActiveTextureUnit(GLenum texUnit);
34 void AlphaFunc(GLenum func, GLclampf ref);
35 void BlendFunc(GLenum sfactor, GLenum dfactor);
36 void DepthFunc(GLenum func);
37 void ActiveStencilFace(GLenum mode);
38 void StencilFunc(GLenum func, GLint ref, GLuint mask);
39 void StencilOp(GLenum fail, GLenum zfail, GLenum zpass);
40 void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
41 void DepthMask(GLboolean flag);
42 void CullFace(GLenum mode);
43 void FrontFace(GLenum mode);
44 void PolygonMode( GLenum mode);
45 void PolygonOffset(GLfloat factor, GLfloat units);
46 void Enable(GLenum cap);
47 void Disable(GLenum cap);
51 enum MatrixModeT { MODELVIEW, PROJECTION, TEXTURE, MATRIX0 };
59 void BindTexture(GLenum target, GLuint texture);
60 void TexEnv(GLenum target, GLenum pname, GLint param);
61 void TexEnv(GLenum target, GLenum pname, GLfloat param);
62 void TexEnv(GLenum target, GLenum pname, GLint* param);
63 void TexEnv(GLenum target, GLenum pname, GLfloat* param);
91 bool Texturing_IsEnabled;
92 GLenum Texturing_Target;
94 bool IsEnabled_TextureGenQ;
95 bool IsEnabled_TextureGenR;
96 bool IsEnabled_TextureGenS;
97 bool IsEnabled_TextureGenT;
100 GLenum ActiveTexUnit_Unit;
101 unsigned long ActiveTexUnit_Index;
102 GLenum AlphaFunc_Func;
103 GLclampf AlphaFunc_Ref;
104 GLenum BlendFunc_sfactor;
105 GLenum BlendFunc_dfactor;
106 GLenum DepthFunc_Func;
107 GLenum ActiveStencilFace_Mode;
108 GLenum StencilFunc_Func[2];
109 GLint StencilFunc_ref[2];
110 GLuint StencilFunc_mask[2];
111 GLenum StencilOp_fail[2];
112 GLenum StencilOp_zfail[2];
113 GLenum StencilOp_zpass[2];
114 GLboolean ColorMask_FlagRed;
115 GLboolean ColorMask_FlagGreen;
116 GLboolean ColorMask_FlagBlue;
117 GLboolean ColorMask_FlagAlpha;
118 GLboolean DepthMask_Flag;
119 GLenum CullFace_mode;
120 GLenum FrontFace_mode;
121 GLenum PolygonMode_mode;
122 GLfloat PolygonOffset_factor;
123 GLfloat PolygonOffset_units;
124 bool IsEnabled_AlphaTest;
125 bool IsEnabled_AutoNormal;
126 bool IsEnabled_Blend;
128 bool IsEnabled_ColorMaterial;
129 bool IsEnabled_CullFace;
130 bool IsEnabled_DepthTest;
131 bool IsEnabled_Dither;
134 bool IsEnabled_Lighting;
135 bool IsEnabled_LineSmooth;
136 bool IsEnabled_LineStipple;
137 bool IsEnabled_LogicOp;
138 bool IsEnabled_Normalize;
139 bool IsEnabled_PointSmooth;
140 bool IsEnabled_PolygonSmooth;
141 bool IsEnabled_PolygonStipple;
142 bool IsEnabled_PolygonOffsetFill;
143 bool IsEnabled_PolygonOffsetLine;
144 bool IsEnabled_PolygonOffsetPoint;
145 bool IsEnabled_ScissorTest;
146 bool IsEnabled_StencilTest;
147 bool IsEnabled_StencilTestTwoSide;
148 unsigned long LoadedMatrixID [3+32];
149 unsigned long LoadedMatrixAge[3+32];
150 TexUnitStateT TexUnitStates[8];
static const GLenum MatrixModeToOpenGL[]
Translates from our MatrixModeT modes to OpenGL matrix modes.
Definition: OpenGLState.hpp:74
This class encapsulates the OpenGL state, with the intention of minimizing actual OpenGL state change...
Definition: OpenGLState.hpp:27
static const GLenum BlendFactorToOpenGL[]
Translates from MaterialT blend factors to OpenGL blend factors.
Definition: OpenGLState.hpp:71
static const GLenum PolygonModeToOpenGL_Offset[]
Translates from MaterialT::PolygonModeT to OpenGL depth offset polygon modes.
Definition: OpenGLState.hpp:73
static const GLenum MeshToOpenGLType[]
Translates from MeshT primitive types to OpenGL rendering primitives.
Definition: OpenGLState.hpp:69
A matrix class with which dependencies among matrices can be handled.
Definition: DepRelMatrix.hpp:22
static const GLenum WindingToOpenGL[]
Translates from MeshT windings to OpenGL windings (cw or ccw).
Definition: OpenGLState.hpp:70
static const GLenum PolygonModeToOpenGL[]
Translates from MaterialT::PolygonModeT to OpenGL polygon modes.
Definition: OpenGLState.hpp:72
void LoadMatrix(MatrixModeT MatrixMode, const DepRelMatrixT &Matrix)
This method loads a matrix.
Definition: OpenGLState.cpp:436