29 #ifndef __GLStateCacheManagerImp_H__
30 #define __GLStateCacheManagerImp_H__
52 mTexParameteriMap.clear();
90 GLenum mBlendEquation;
92 GLenum mBlendFuncSource;
94 GLenum mBlendFuncDest;
104 size_t mActiveTextureUnit;
106 unsigned int mDiscardBuffers;
108 GLclampf mClearDepth;
112 GLenum mBlendEquationRGB;
113 GLenum mBlendEquationAlpha;
118 GLfloat mSpecular[4];
119 GLfloat mEmissive[4];
120 GLfloat mLightAmbient[4];
123 GLfloat mPointAttenuation[3];
125 GLfloat mPointSizeMin;
126 GLfloat mPointSizeMax;
129 GLStateCacheManagerImp(
void);
130 ~GLStateCacheManagerImp(
void);
133 void initializeCache();
139 void bindGLBuffer(GLenum target, GLuint buffer, GLenum attach = 0,
bool force =
false);
142 void deleteGLBuffer(GLenum target, GLuint buffer, GLenum attach = 0,
bool force =
false);
145 void bindGLTexture(GLenum target, GLuint texture);
148 void setTexParameteri(GLenum target, GLenum pname, GLint param);
151 void invalidateStateForTexture(GLuint texture);
154 bool activateGLTextureUnit(
size_t unit);
160 void setBlendEquation(GLenum eq);
163 void setBlendEquation(GLenum eqRGB, GLenum eqA);
166 void setBlendFunc(GLenum source, GLenum dest);
169 void setShadeModel(GLenum model);
172 void setLightAmbient(GLfloat r, GLfloat g, GLfloat b);
178 void setDepthMask(GLboolean mask);
184 void setDepthFunc(GLenum func);
190 void setClearDepth(GLclampf depth);
193 void setClearColour(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
199 void setColourMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
205 void setStencilMask(GLuint mask);
208 void setEnabled(GLenum flag,
bool enabled);
220 void setPolygonMode(GLenum mode);
226 void setCullFace(GLenum face);
229 void enableTextureCoordGen(GLenum type);
231 void disableTextureCoordGen(GLenum type);
234 void setMaterialAmbient(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
235 void setMaterialDiffuse(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
236 void setMaterialEmissive(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
237 void setMaterialSpecular(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
238 void setMaterialShininess(GLfloat shininess);
239 void setPointSize(GLfloat size);
240 void setPointParameters(GLfloat* attenuation,
float minSize,
float maxSize);
243 void setViewport(GLint x, GLint y, GLsizei width, GLsizei height);
246 void getViewport(
int* array);
GLenum getCullFace(void) const
See GLStateCacheManager.getCullFace.
BindBufferMap mActiveBufferMap
A map of different buffer types and the currently bound buffer for each type.
GLenum getBlendEquation(void) const
See GLStateCacheManager.getBlendEquation.
TexParameteriMap mTexParameteriMap
HashMap< GLenum, GLuint > BindBufferMap
HashMap< GLenum, bool > GLbooleanStateMap
unsigned int getDiscardBuffers(void) const
See GLStateCacheManager.getDiscardBuffers.
GLuint getStencilMask(void) const
See GLStateCacheManager.getStencilMask.
GLboolean getDepthMask(void) const
See GLStateCacheManager.getDepthMask.
TexUnitsMap mTexUnitsMap
A map of texture parameters for each texture unit.
Ogre::GeneralAllocatedObject StateCacheAlloc
GLclampf getClearDepth(void) const
See GLStateCacheManager.getClearDepth.
HashMap< GLenum, GLuint > mBoundTextures
Stores textures currently bound to each texture stage.
HashMap< GLenum, TexGenParams > mTextureCoordGen
Stores the currently enabled texcoord generation types per texture unit.
std::set< GLenum > mEnabled
GLbooleanStateMap mBoolStateMap
Array of each OpenGL feature that is enabled i.e. blending, depth test, etc.
HashMap< GLenum, GLint > TexParameteriMap
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
GLenum getDepthFunc(void) const
See GLStateCacheManager.getDepthFunc.
vector< GLboolean >::type & getColourMask(void)
See GLStateCacheManager.getColourMask.
GLuint mLastBoundTexID
Stores the last bound texture id.
HashMap< GLuint, TextureUnitParams > TexUnitsMap
void setDiscardBuffers(unsigned int flags)
See GLStateCacheManager.setDiscardBuffers.
GLenum getPolygonMode(void) const
See GLStateCacheManager.getPolygonMode.