GL Studio Safety Critical Embedded C++ Runtime Library
|
#include <gls_state_manager.h>
Public Member Functions | |
void | ResetOpenGLState (void) |
void | Begin (const GLenum mode) |
void | End (void) |
void | BindTexture2D (const GLuint textureIndex) |
void | LineWidth (const GLfloat lineWidth) |
void | AlphaFunc (const GLenum func, const GLclampf ref) |
void | Color (const GlsColor &color) |
void | BlendFunc (const GLenum sfactor, const GLenum dfactor) |
void | ShadeModel (const GLenum mode) |
void | DepthFunc (const GLenum func) |
void | EnableAlphaTest (const GlsBool enable) |
void | EnableBlend (const GlsBool enable) |
void | EnableCullFace (const GlsBool enable) |
void | EnableDepthTest (const GlsBool enable) |
void | EnableLineSmooth (const GlsBool enable) |
void | EnableTexture2D (const GlsBool enable) |
void | TexParameteri2D (const GLenum pname, const GLint param) |
void | TexEnvi (const GLint param) |
Static Public Member Functions | |
static GlsStateManager & | GetStateManager (void) |
Static Public Attributes | |
static const GLuint | INVALID_GL_TEXTURE_INDEX = 0u |
Protected Member Functions | |
GlsStateManager (void) | |
virtual | ~GlsStateManager () |
Protected Attributes | |
GLenum | _alphaFunc |
GLclampf | _alphaRef |
GlsBool | _alphaTest |
GlsBool | _alphaBlend |
GLenum | _alphaBlendSFactor |
GLenum | _alphaBlendDFactor |
GlsBool | _depthTest |
GLenum | _depthFunc |
GlsBool | _lineSmooth |
GlsBool | _cullFace |
GLenum | _shadeModel |
GlsColor | _color |
GlsBool | _texture2D |
GLuint | _textureIndex2D |
GLfloat | _lineWidth |
GLenum | _polygonMode |
This class manages OpenGL context state and allows for minimizing calls to OpenGL.
|
protected |
Constructor - create an instance
|
protectedvirtual |
Destructor - shall never be called
void GlsStateManager::AlphaFunc | ( | const GLenum | func, |
const GLclampf | ref | ||
) |
equivalent to glAlphaFunc() call
func | GL alpha comparison mode |
ref | GL alpha reference value |
void GlsStateManager::Begin | ( | const GLenum | mode | ) |
equivalent to glBegin() call
mode | primitive mode to begin |
void GlsStateManager::BindTexture2D | ( | const GLuint | textureIndex | ) |
equivalent to glBindTexture( GL_TEXTURE_2D, .. ) call
textureIndex | GL texture index of texture to bind ( >0 ) |
void GlsStateManager::BlendFunc | ( | const GLenum | sfactor, |
const GLenum | dfactor | ||
) |
equivalent to glBlendFunc() call
sfactor | alpha source mode |
dfactor | alpha destination mode |
void GlsStateManager::Color | ( | const GlsColor & | color | ) |
equivalent to glColor() call
color | new color |
void GlsStateManager::DepthFunc | ( | const GLenum | func | ) |
equivalent to glDepthFunc() call
func | new GL depth function |
void GlsStateManager::EnableAlphaTest | ( | const GlsBool | enable | ) |
equivalent to glEnable(GL_ALPHA_TEST)/glDisable(GL_ALPHA_TEST) call
enable | GLS_TRUE to enable else GLS_FALSE |
void GlsStateManager::EnableBlend | ( | const GlsBool | enable | ) |
equivalent to glEnable(GL_BLEND)/glDisable(GL_BLEND) call
enable | GLS_TRUE to enable else GLS_FALSE |
void GlsStateManager::EnableCullFace | ( | const GlsBool | enable | ) |
equivalent to glEnable(GL_CULL_FACE)/glDisable(GL_CULL_FACE) call
enable | GLS_TRUE to enable else GLS_FALSE |
void GlsStateManager::EnableDepthTest | ( | const GlsBool | enable | ) |
equivalent to glEnable(GL_DEPTH_TEST)/glDisable(GL_DEPTH_TEST) call
enable | GLS_TRUE to enable else GLS_FALSE |
void GlsStateManager::EnableLineSmooth | ( | const GlsBool | enable | ) |
equivalent to glEnable(GL_LINE_SMOOTH)/glDisable(GL_LINE_SMOOTH) call
enable | GLS_TRUE to enable else GLS_FALSE |
void GlsStateManager::EnableTexture2D | ( | const GlsBool | enable | ) |
equivalent to glEnable(GL_TEXTURE_2D)/glDisable(GL_TEXTURE_2D) call
enable | GLS_TRUE to enable else GLS_FALSE |
void GlsStateManager::End | ( | void | ) |
equivalent to glEnd() call
|
static |
Get the singleton GlsStateManager instance
void GlsStateManager::LineWidth | ( | const GLfloat | lineWidth | ) |
equivalent to glLineWidth() call
lineWidth | new line width ( GlsStateManager::LINE_WIDTH_MIN <= width <= GlsStateManager::LINE_WIDTH_MAX ) |
void GlsStateManager::ResetOpenGLState | ( | void | ) |
Reset the cached GL state variables and set them into the GL state
void GlsStateManager::ShadeModel | ( | const GLenum | mode | ) |
equivalent to glShadeModel() call
mode | new GL shade mode |
void GlsStateManager::TexEnvi | ( | const GLint | param | ) |
equivalent to glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,...) call
param | new value for texture environment mode |
void GlsStateManager::TexParameteri2D | ( | const GLenum | pname, |
const GLint | param | ||
) |
equivalent to glTexParameteri(GL_TEXTURE_2D,...) call
pname | GL texture parameter name |
param | new value for indicated parameter |
|
protected |
current GL Alpha Blending state
|
protected |
current GL Alpha Blending destination factor
|
protected |
current GL Alpha Blending source factor
|
protected |
current GL alpha function
|
protected |
current GL alpha reference value
|
protected |
current GL Alpha Testing state (Screen door transparency)
|
protected |
current GL Drawing color
|
protected |
current GL Backface culling state
|
protected |
current GL Depth Testing function
|
protected |
current GL Depth Testing state
|
protected |
current GL Line anti-aliasing
|
protected |
current GL Line width
|
protected |
current GL Polygon Draw Mode
|
protected |
current GL shading model
|
protected |
current GL 2D texture state
|
protected |
current index of GL 2D bound texture else GlsStateManager::INVALID_GL_TEXTURE_INDEX if no texture is bound
|
static |
invalid GL texture index