29 #ifndef __GLStateCacheManagerImp_H__ 30 #define __GLStateCacheManagerImp_H__ 51 mTexParameteriMap.clear();
89 GLenum mBlendEquation;
91 GLenum mBlendFuncSource;
93 GLenum mBlendFuncDest;
103 size_t mActiveTextureUnit;
105 unsigned int mDiscardBuffers;
107 GLclampf mClearDepth;
111 GLenum mBlendEquationRGB;
112 GLenum mBlendEquationAlpha;
117 GLfloat mSpecular[4];
118 GLfloat mEmissive[4];
119 GLfloat mLightAmbient[4];
122 GLfloat mPointAttenuation[3];
124 GLfloat mPointSizeMin;
125 GLfloat mPointSizeMax;
128 GLStateCacheManagerImp(
void);
129 ~GLStateCacheManagerImp(
void);
132 void initializeCache();
138 void bindGLBuffer(GLenum target, GLuint buffer, GLenum attach = 0,
bool force =
false);
141 void deleteGLBuffer(GLenum target, GLuint buffer, GLenum attach = 0,
bool force =
false);
144 void bindGLTexture(GLenum target, GLuint texture);
147 void setTexParameteri(GLenum target, GLenum pname, GLint param);
150 void invalidateStateForTexture(GLuint texture);
153 bool activateGLTextureUnit(
size_t unit);
159 void setBlendEquation(GLenum eq);
162 void setBlendEquation(GLenum eqRGB, GLenum eqA);
165 void setBlendFunc(GLenum source, GLenum dest);
168 void setShadeModel(GLenum model);
171 void setLightAmbient(GLfloat r, GLfloat g, GLfloat b);
177 void setDepthMask(GLboolean mask);
183 void setDepthFunc(GLenum func);
189 void setClearDepth(GLclampf depth);
192 void setClearColour(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
198 void setColourMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
204 void setStencilMask(GLuint mask);
207 void setEnabled(GLenum flag);
210 void setDisabled(GLenum flag);
222 void setPolygonMode(GLenum mode);
228 void setCullFace(GLenum face);
231 void enableTextureCoordGen(GLenum type);
233 void disableTextureCoordGen(GLenum type);
236 void setMaterialAmbient(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
237 void setMaterialDiffuse(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
238 void setMaterialEmissive(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
239 void setMaterialSpecular(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
240 void setMaterialShininess(GLfloat shininess);
241 void setPointSize(GLfloat size);
242 void setPointParameters(GLfloat* attenuation,
float minSize,
float maxSize);
245 void setViewport(GLint x, GLint y, GLsizei width, GLsizei height);
248 void getViewport(
int* array);
GLclampf getClearDepth(void) const
See GLStateCacheManager.getClearDepth.
GLuint getStencilMask(void) const
See GLStateCacheManager.getStencilMask.
TexParameteriMap mTexParameteriMap
GLenum getBlendEquation(void) const
See GLStateCacheManager.getBlendEquation.
vector< GLboolean >::type & getColourMask(void)
See GLStateCacheManager.getColourMask.
HashMap< GLuint, TextureUnitParams > TexUnitsMap
HashMap< GLenum, GLuint > BindBufferMap
unsigned int getDiscardBuffers(void) const
See GLStateCacheManager.getDiscardBuffers.
GLenum getCullFace(void) const
See GLStateCacheManager.getCullFace.
vector< GLenum >::type mEnableVector
Array of each OpenGL feature that is enabled i.e. blending, depth test, etc.
Ogre::GeneralAllocatedObject StateCacheAlloc
BindBufferMap mActiveBufferMap
A map of different buffer types and the currently bound buffer for each type.
GLenum getDepthFunc(void) const
See GLStateCacheManager.getDepthFunc.
HashMap< GLenum, GLuint > mBoundTextures
Stores textures currently bound to each texture stage.
GLboolean getDepthMask(void) const
See GLStateCacheManager.getDepthMask.
GLuint mLastBoundTexID
Stores the last bound texture id.
void setDiscardBuffers(unsigned int flags)
See GLStateCacheManager.setDiscardBuffers.
This source file is part of OGRE (Object-oriented Graphics Rendering Engine) For the latest info...
GLenum getPolygonMode(void) const
See GLStateCacheManager.getPolygonMode.
std::set< GLenum > mEnabled
TexUnitsMap mTexUnitsMap
A map of texture parameters for each texture unit.
HashMap< GLenum, TexGenParams > mTextureCoordGen
Stores the currently enabled texcoord generation types per texture unit.
HashMap< GLenum, GLint > TexParameteriMap
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...