OgreGLES2NullStateCacheManagerImp.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-2013 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 
29 #ifndef __GLES2NullStateCacheManagerImp_H__
30 #define __GLES2NullStateCacheManagerImp_H__
31 
32 #include "OgreGLES2Prerequisites.h"
33 
35 
36 namespace Ogre
37 {
42  {
43  private:
49  GLboolean mDepthMask;
51  GLenum mPolygonMode;
55  GLenum mCullFace;
57  GLenum mDepthFunc;
59  GLuint mStencilMask;
61  unsigned char mActiveTextureUnit;
63  unsigned int mDiscardBuffers;
65  GLclampf mClearDepth;
66 
67  public:
70 
72  void initializeCache();
73 
75  void clearCache();
76 
78  void bindGLBuffer(GLenum target, GLuint buffer, bool force = false);
79 
81  void deleteGLBuffer(GLenum target, GLuint buffer, bool force = false);
82 
84  void bindGLTexture(GLenum target, GLuint texture);
85 
87  void invalidateStateForTexture(GLuint texture);
88 
90  void setTexParameteri(GLenum target, GLenum pname, GLint param);
91 
93  void setTexParameterf(GLenum target, GLenum pname, GLfloat params);
94 
96  void getTexParameterfv(GLenum target, GLenum pname, GLfloat *params);
97 
99  bool activateGLTextureUnit(unsigned char unit);
100 
102  GLenum getBlendEquation(void) const { return mBlendEquation; }
103 
105  void setBlendEquation(GLenum eq);
106 
108  void setBlendFunc(GLenum source, GLenum dest);
109 
111  GLboolean getDepthMask(void) const { return mDepthMask; }
112 
114  void setDepthMask(GLboolean mask);
115 
117  GLenum getDepthFunc(void) const { return mDepthFunc; }
118 
120  void setDepthFunc(GLenum func);
121 
123  GLclampf getClearDepth(void) const { return mClearDepth; }
124 
126  void setClearDepth(GLclampf depth);
127 
129  void setClearColour(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
130 
133 
135  void setColourMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
136 
138  GLuint getStencilMask(void) const { return mStencilMask; }
139 
141  void setStencilMask(GLuint mask);
142 
144  void setEnabled(GLenum flag);
145 
147  void setDisabled(GLenum flag);
148 
150  void setVertexAttribEnabled(GLuint attrib);
151 
153  void setVertexAttribDisabled(GLuint attrib);
154 
156  unsigned int getDiscardBuffers(void) const { return mDiscardBuffers; }
157 
159  void setDiscardBuffers(unsigned int flags) { mDiscardBuffers = flags; }
160 
162  GLenum getPolygonMode(void) const { return mPolygonMode; }
163 
165  void setPolygonMode(GLenum mode) { mPolygonMode = mode; }
166 
168  GLenum getCullFace(void) const { return mCullFace; }
169 
171  void setCullFace(GLenum face);
172  };
173 }
174 
175 #endif
Ogre::GLES2StateCacheManagerImp::setTexParameterf
void setTexParameterf(GLenum target, GLenum pname, GLfloat params)
See GLES2StateCacheManager.setTexParameterf.
Ogre::GLES2StateCacheManagerImp::mClearColour
vector< GLclampf >::type mClearColour
Stores the current clear colour.
Definition: OgreGLES2NullStateCacheManagerImp.h:45
Ogre::AllocatedObject
Superclass for all objects that wish to use custom memory allocators when their new / delete operator...
Definition: OgreMemoryAllocatedObject.h:58
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::GLES2StateCacheManagerImp::setStencilMask
void setStencilMask(GLuint mask)
See GLES2StateCacheManager.setStencilMask.
Ogre::GLES2StateCacheManagerImp::getClearDepth
GLclampf getClearDepth(void) const
See GLES2StateCacheManager.getClearDepth.
Definition: OgreGLES2NullStateCacheManagerImp.h:123
Ogre::GLES2StateCacheManagerImp::setPolygonMode
void setPolygonMode(GLenum mode)
See GLES2StateCacheManager.setPolygonMode.
Definition: OgreGLES2NullStateCacheManagerImp.h:165
Ogre::GLES2StateCacheManagerImp::mClearDepth
GLclampf mClearDepth
Stores the current depth clearing colour.
Definition: OgreGLES2NullStateCacheManagerImp.h:65
Ogre::GLES2StateCacheManagerImp::getDepthFunc
GLenum getDepthFunc(void) const
See GLES2StateCacheManager.getDepthFunc.
Definition: OgreGLES2NullStateCacheManagerImp.h:117
Ogre::GLES2StateCacheManagerImp::setTexParameteri
void setTexParameteri(GLenum target, GLenum pname, GLint param)
See GLES2StateCacheManager.setTexParameteri.
Ogre::GLES2StateCacheManagerImp::getCullFace
GLenum getCullFace(void) const
See GLES2StateCacheManager.getCullFace.
Definition: OgreGLES2NullStateCacheManagerImp.h:168
Ogre::GLES2StateCacheManagerImp::mDiscardBuffers
unsigned int mDiscardBuffers
Mask of buffers who contents can be discarded if GL_EXT_discard_framebuffer is supported.
Definition: OgreGLES2NullStateCacheManagerImp.h:63
Ogre::GLES2StateCacheManagerImp::bindGLTexture
void bindGLTexture(GLenum target, GLuint texture)
See GLES2StateCacheManager.bindGLTexture.
Ogre::GLES2StateCacheManagerImp::clearCache
void clearCache()
See GLES2StateCacheManager.clearCache.
Ogre::GLES2StateCacheManagerImp::getBlendEquation
GLenum getBlendEquation(void) const
See GLES2StateCacheManager.getBlendEquation.
Definition: OgreGLES2NullStateCacheManagerImp.h:102
Ogre::GLES2StateCacheManagerImp::getDepthMask
GLboolean getDepthMask(void) const
See GLES2StateCacheManager.getDepthMask.
Definition: OgreGLES2NullStateCacheManagerImp.h:111
Ogre::GLES2StateCacheManagerImp::setClearColour
void setClearColour(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
See GLES2StateCacheManager.setClearColour.
Ogre::GLES2StateCacheManagerImp::getTexParameterfv
void getTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
See GLES2StateCacheManager.getTexParameterfv.
Ogre::GLES2StateCacheManagerImp::setCullFace
void setCullFace(GLenum face)
See GLES2StateCacheManager.setCullFace.
Ogre::GLES2StateCacheManagerImp::mDepthFunc
GLenum mDepthFunc
Stores the current depth test function.
Definition: OgreGLES2NullStateCacheManagerImp.h:57
Ogre::GLES2StateCacheManagerImp::getPolygonMode
GLenum getPolygonMode(void) const
See GLES2StateCacheManager.getPolygonMode.
Definition: OgreGLES2NullStateCacheManagerImp.h:162
Ogre::GLES2StateCacheManagerImp
An in memory cache of the OpenGL ES state.
Definition: OgreGLES2NullStateCacheManagerImp.h:41
Ogre::GLES2StateCacheManagerImp::mPolygonMode
GLenum mPolygonMode
Stores the current polygon rendering mode.
Definition: OgreGLES2NullStateCacheManagerImp.h:51
Ogre::GLES2StateCacheManagerImp::~GLES2StateCacheManagerImp
~GLES2StateCacheManagerImp(void)
Ogre::GLES2StateCacheManagerImp::initializeCache
void initializeCache()
See GLES2StateCacheManager.initializeCache.
Ogre::GLES2StateCacheManagerImp::setDepthMask
void setDepthMask(GLboolean mask)
See GLES2StateCacheManager.setDepthMask.
Ogre::GLES2StateCacheManagerImp::setVertexAttribDisabled
void setVertexAttribDisabled(GLuint attrib)
See GLES2StateCacheManager.setVertexAttribDisabled.
Ogre::GLES2StateCacheManagerImp::bindGLBuffer
void bindGLBuffer(GLenum target, GLuint buffer, bool force=false)
See GLES2StateCacheManager.bindGLBuffer.
Ogre::GLES2StateCacheManagerImp::deleteGLBuffer
void deleteGLBuffer(GLenum target, GLuint buffer, bool force=false)
See GLES2StateCacheManager.deleteGLBuffer.
Ogre::GLES2StateCacheManagerImp::GLES2StateCacheManagerImp
GLES2StateCacheManagerImp(void)
Ogre::GLES2StateCacheManagerImp::setDepthFunc
void setDepthFunc(GLenum func)
See GLES2StateCacheManager.setDepthFunc.
Ogre::GLES2StateCacheManagerImp::mStencilMask
GLuint mStencilMask
Stores the current stencil mask.
Definition: OgreGLES2NullStateCacheManagerImp.h:59
Ogre::GLES2StateCacheManagerImp::mActiveTextureUnit
unsigned char mActiveTextureUnit
Stores the currently active texture unit.
Definition: OgreGLES2NullStateCacheManagerImp.h:61
Ogre::GLES2StateCacheManagerImp::setDisabled
void setDisabled(GLenum flag)
See GLES2StateCacheManager.setDisabled.
Ogre::GLES2StateCacheManagerImp::setColourMask
void setColourMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
See GLES2StateCacheManager.setColourMask.
Ogre::GLES2StateCacheManagerImp::setDiscardBuffers
void setDiscardBuffers(unsigned int flags)
See GLES2StateCacheManager.setDiscardBuffers.
Definition: OgreGLES2NullStateCacheManagerImp.h:159
Ogre::GLES2StateCacheManagerImp::setVertexAttribEnabled
void setVertexAttribEnabled(GLuint attrib)
See GLES2StateCacheManager.setVertexAttribEnabled.
StateCacheAlloc
Ogre::GeneralAllocatedObject StateCacheAlloc
Definition: OgreGLES2NullStateCacheManagerImp.h:34
Ogre::GLES2StateCacheManagerImp::invalidateStateForTexture
void invalidateStateForTexture(GLuint texture)
See GLES2StateCacheManager.invalidateStateForTexture.
Ogre::GLES2StateCacheManagerImp::getStencilMask
GLuint getStencilMask(void) const
See GLES2StateCacheManager.getStencilMask.
Definition: OgreGLES2NullStateCacheManagerImp.h:138
Ogre::GLES2StateCacheManagerImp::mDepthMask
GLboolean mDepthMask
Stores the current depth write mask.
Definition: OgreGLES2NullStateCacheManagerImp.h:49
Ogre::GLES2StateCacheManagerImp::mColourMask
vector< GLboolean >::type mColourMask
Stores the current colour write mask.
Definition: OgreGLES2NullStateCacheManagerImp.h:47
Ogre::GLES2StateCacheManagerImp::setEnabled
void setEnabled(GLenum flag)
See GLES2StateCacheManager.setEnabled.
Ogre::GLES2StateCacheManagerImp::setBlendEquation
void setBlendEquation(GLenum eq)
See GLES2StateCacheManager.setBlendEquation.
Ogre::GLES2StateCacheManagerImp::mBlendEquation
GLenum mBlendEquation
Stores the current blend equation.
Definition: OgreGLES2NullStateCacheManagerImp.h:53
Ogre::GLES2StateCacheManagerImp::setBlendFunc
void setBlendFunc(GLenum source, GLenum dest)
See GLES2StateCacheManager.setBlendFunc.
Ogre::GLES2StateCacheManagerImp::mCullFace
GLenum mCullFace
Stores the current face culling setting.
Definition: OgreGLES2NullStateCacheManagerImp.h:55
Ogre::GLES2StateCacheManagerImp::activateGLTextureUnit
bool activateGLTextureUnit(unsigned char unit)
See GLES2StateCacheManager.activateGLTextureUnit.
Ogre::vector
Definition: OgrePrerequisites.h:491
Ogre::GLES2StateCacheManagerImp::setClearDepth
void setClearDepth(GLclampf depth)
See GLES2StateCacheManager.setClearDepth.
Ogre::GLES2StateCacheManagerImp::getColourMask
vector< GLboolean >::type & getColourMask(void)
See GLES2StateCacheManager.getColourMask.
Definition: OgreGLES2NullStateCacheManagerImp.h:132
OgreGLES2Prerequisites.h
Ogre::GLES2StateCacheManagerImp::getDiscardBuffers
unsigned int getDiscardBuffers(void) const
See GLES2StateCacheManager.getDiscardBuffers.
Definition: OgreGLES2NullStateCacheManagerImp.h:156

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Tue Apr 13 2021 08:53:15