OgreGLESNullStateCacheManagerImp.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 __GLESNullStateCacheManagerImp_H__
30 #define __GLESNullStateCacheManagerImp_H__
31 
32 #include "OgreGLESPrerequisites.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, GLenum attach = 0, bool force = false);
79 
81  void deleteGLBuffer(GLenum target, GLuint buffer, GLenum attach = 0, bool force = false);
82 
84  void bindGLTexture(GLenum target, GLuint texture);
85 
87  void setTexParameteri(GLenum target, GLenum pname, GLint param);
88 
90  bool activateGLTextureUnit(unsigned char unit);
91 
93  GLenum getBlendEquation(void) const { return mBlendEquation; }
94 
96  void setBlendEquation(GLenum eq);
97 
99  void setBlendFunc(GLenum source, GLenum dest);
100 
102  GLboolean getDepthMask(void) const { return mDepthMask; }
103 
105  void setDepthMask(GLboolean mask);
106 
108  GLenum getDepthFunc(void) const { return mDepthFunc; }
109 
111  void setDepthFunc(GLenum func);
112 
114  GLclampf getClearDepth(void) const { return mClearDepth; }
115 
117  void setClearDepth(GLclampf depth);
118 
120  void setClearColour(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
121 
124 
126  void setColourMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
127 
129  GLuint getStencilMask(void) const { return mStencilMask; }
130 
132  void setStencilMask(GLuint mask);
133 
135  void setEnabled(GLenum flag);
136 
138  void setDisabled(GLenum flag);
139 
141  unsigned int getDiscardBuffers(void) const { return mDiscardBuffers; }
142 
144  void setDiscardBuffers(unsigned int flags) { mDiscardBuffers = flags; }
145 
147  GLenum getPolygonMode(void) const { return mPolygonMode; }
148 
150  void setPolygonMode(GLenum mode) { mPolygonMode = mode; }
151 
153  GLenum getCullFace(void) const { return mCullFace; }
154 
156  void setCullFace(GLenum face);
157  };
158 }
159 
160 #endif
Ogre::GLESStateCacheManagerImp::mCullFace
GLenum mCullFace
Stores the current face culling setting.
Definition: OgreGLESNullStateCacheManagerImp.h:55
Ogre::GLESStateCacheManagerImp::mDepthFunc
GLenum mDepthFunc
Stores the current depth test function.
Definition: OgreGLESNullStateCacheManagerImp.h:57
Ogre::GLESStateCacheManagerImp::getCullFace
GLenum getCullFace(void) const
See GLESStateCacheManager.getCullFace.
Definition: OgreGLESNullStateCacheManagerImp.h:153
Ogre::GLESStateCacheManagerImp::setClearColour
void setClearColour(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
See GLESStateCacheManager.setClearColour.
Ogre::GLESStateCacheManagerImp::bindGLTexture
void bindGLTexture(GLenum target, GLuint texture)
See GLESStateCacheManager.bindGLTexture.
Ogre::GLESStateCacheManagerImp::setCullFace
void setCullFace(GLenum face)
See GLESStateCacheManager.setCullFace.
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::GLESStateCacheManagerImp::~GLESStateCacheManagerImp
~GLESStateCacheManagerImp(void)
Ogre::GLESStateCacheManagerImp::mPolygonMode
GLenum mPolygonMode
Stores the current polygon rendering mode.
Definition: OgreGLESNullStateCacheManagerImp.h:51
Ogre::GLESStateCacheManagerImp::setColourMask
void setColourMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
See GLESStateCacheManager.setColourMask.
Ogre::GLESStateCacheManagerImp::getStencilMask
GLuint getStencilMask(void) const
See GLESStateCacheManager.getStencilMask.
Definition: OgreGLESNullStateCacheManagerImp.h:129
Ogre::GLESStateCacheManagerImp::getDepthFunc
GLenum getDepthFunc(void) const
See GLESStateCacheManager.getDepthFunc.
Definition: OgreGLESNullStateCacheManagerImp.h:108
Ogre::GLESStateCacheManagerImp::GLESStateCacheManagerImp
GLESStateCacheManagerImp(void)
_OgreGLESExport
#define _OgreGLESExport
Definition: OgreGLESPrerequisites.h:139
Ogre::GLESStateCacheManagerImp::setBlendFunc
void setBlendFunc(GLenum source, GLenum dest)
See GLESStateCacheManager.setBlendFunc.
OgreGLESPrerequisites.h
Ogre::GLESStateCacheManagerImp::mDiscardBuffers
unsigned int mDiscardBuffers
Mask of buffers who contents can be discarded if GL_EXT_discard_framebuffer is supported.
Definition: OgreGLESNullStateCacheManagerImp.h:63
Ogre::GLESStateCacheManagerImp::activateGLTextureUnit
bool activateGLTextureUnit(unsigned char unit)
See GLESStateCacheManager.activateGLTextureUnit.
Ogre::GLESStateCacheManagerImp::setBlendEquation
void setBlendEquation(GLenum eq)
See GLESStateCacheManager.setBlendEquation.
Ogre::GLESStateCacheManagerImp::mActiveTextureUnit
unsigned char mActiveTextureUnit
Stores the currently active texture unit.
Definition: OgreGLESNullStateCacheManagerImp.h:61
Ogre::GLESStateCacheManagerImp::setPolygonMode
void setPolygonMode(GLenum mode)
See GLESStateCacheManager.setPolygonMode.
Definition: OgreGLESNullStateCacheManagerImp.h:150
Ogre::GLESStateCacheManagerImp::bindGLBuffer
void bindGLBuffer(GLenum target, GLuint buffer, GLenum attach=0, bool force=false)
See GLESStateCacheManager.bindGLBuffer.
Ogre::GLESStateCacheManagerImp::mBlendEquation
GLenum mBlendEquation
Stores the current blend equation.
Definition: OgreGLESNullStateCacheManagerImp.h:53
Ogre::GLESStateCacheManagerImp::getColourMask
vector< GLboolean >::type & getColourMask(void)
See GLESStateCacheManager.getColourMask.
Definition: OgreGLESNullStateCacheManagerImp.h:123
Ogre::GLESStateCacheManagerImp::mClearDepth
GLclampf mClearDepth
Stores the current depth clearing colour.
Definition: OgreGLESNullStateCacheManagerImp.h:65
Ogre::GLESStateCacheManagerImp::mClearColour
vector< GLclampf >::type mClearColour
Stores the current clear colour.
Definition: OgreGLESNullStateCacheManagerImp.h:45
Ogre::GLESStateCacheManagerImp
An in memory cache of the OpenGL ES state.
Definition: OgreGLESNullStateCacheManagerImp.h:41
Ogre::GLESStateCacheManagerImp::getDepthMask
GLboolean getDepthMask(void) const
See GLESStateCacheManager.getDepthMask.
Definition: OgreGLESNullStateCacheManagerImp.h:102
Ogre::GLESStateCacheManagerImp::setDisabled
void setDisabled(GLenum flag)
See GLESStateCacheManager.setDisabled.
Ogre::GLESStateCacheManagerImp::setEnabled
void setEnabled(GLenum flag)
See GLESStateCacheManager.setEnabled.
Ogre::GLESStateCacheManagerImp::setTexParameteri
void setTexParameteri(GLenum target, GLenum pname, GLint param)
See GLESStateCacheManager.setTexParameteri.
Ogre::GLESStateCacheManagerImp::getBlendEquation
GLenum getBlendEquation(void) const
See GLESStateCacheManager.getBlendEquation.
Definition: OgreGLESNullStateCacheManagerImp.h:93
Ogre::GLESStateCacheManagerImp::initializeCache
void initializeCache()
See GLESStateCacheManager.initializeCache.
Ogre::GLESStateCacheManagerImp::setClearDepth
void setClearDepth(GLclampf depth)
See GLESStateCacheManager.setClearDepth.
Ogre::GLESStateCacheManagerImp::setStencilMask
void setStencilMask(GLuint mask)
See GLESStateCacheManager.setStencilMask.
Ogre::GLESStateCacheManagerImp::getClearDepth
GLclampf getClearDepth(void) const
See GLESStateCacheManager.getClearDepth.
Definition: OgreGLESNullStateCacheManagerImp.h:114
Ogre::GLESStateCacheManagerImp::setDiscardBuffers
void setDiscardBuffers(unsigned int flags)
See GLESStateCacheManager.setDiscardBuffers.
Definition: OgreGLESNullStateCacheManagerImp.h:144
Ogre::GLESStateCacheManagerImp::setDepthMask
void setDepthMask(GLboolean mask)
See GLESStateCacheManager.setDepthMask.
Ogre::GLESStateCacheManagerImp::getPolygonMode
GLenum getPolygonMode(void) const
See GLESStateCacheManager.getPolygonMode.
Definition: OgreGLESNullStateCacheManagerImp.h:147
Ogre::GLESStateCacheManagerImp::mColourMask
vector< GLboolean >::type mColourMask
Stores the current colour write mask.
Definition: OgreGLESNullStateCacheManagerImp.h:47
Ogre::GLESStateCacheManagerImp::deleteGLBuffer
void deleteGLBuffer(GLenum target, GLuint buffer, GLenum attach=0, bool force=false)
See GLESStateCacheManager.deleteGLBuffer.
StateCacheAlloc
_OgreGLESExport Ogre::GeneralAllocatedObject StateCacheAlloc
Definition: OgreGLESNullStateCacheManagerImp.h:34
Ogre::GLESStateCacheManagerImp::mStencilMask
GLuint mStencilMask
Stores the current stencil mask.
Definition: OgreGLESNullStateCacheManagerImp.h:59
Ogre::GLESStateCacheManagerImp::setDepthFunc
void setDepthFunc(GLenum func)
See GLESStateCacheManager.setDepthFunc.
Ogre::vector
Definition: OgrePrerequisites.h:491
Ogre::GLESStateCacheManagerImp::clearCache
void clearCache()
See GLESStateCacheManager.clearCache.
Ogre::GLESStateCacheManagerImp::getDiscardBuffers
unsigned int getDiscardBuffers(void) const
See GLESStateCacheManager.getDiscardBuffers.
Definition: OgreGLESNullStateCacheManagerImp.h:141
Ogre::GLESStateCacheManagerImp::mDepthMask
GLboolean mDepthMask
Stores the current depth write mask.
Definition: OgreGLESNullStateCacheManagerImp.h:49

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