1 #ifndef _GLS_STATE_MANAGER_H
2 #define _GLS_STATE_MANAGER_H
68 #if defined( GLS_DEBUG )
69 static const GLfloat LINE_WIDTH_MIN;
70 static const GLfloat LINE_WIDTH_MAX;
96 void Begin(
const GLenum mode );
118 void LineWidth(
const GLfloat lineWidth );
127 void AlphaFunc(
const GLenum func,
const GLclampf ref );
144 void BlendFunc(
const GLenum sfactor,
const GLenum dfactor );
227 void TexEnvi(
const GLint param );
229 #if defined( GLS_DEBUG )
235 static GlsUInt32 GetNumberOfInstancesCreated(
void );
274 #if defined( GLS_DEBUG )
292 #if defined( GLS_DEBUG )
293 #pragma BullseyeCoverage save off
300 inline GlsBool GlsGLAlphaFuncIsValid(
const GLenum alphaFunc )
302 return( ( GL_NEVER == alphaFunc ) || ( GL_LESS == alphaFunc ) || ( GL_EQUAL == alphaFunc ) ||
303 ( GL_LEQUAL == alphaFunc ) || ( GL_GREATER == alphaFunc ) || ( GL_NOTEQUAL == alphaFunc ) ||
304 ( GL_GEQUAL == alphaFunc ) || ( GL_ALWAYS == alphaFunc ) );
306 #pragma BullseyeCoverage restore
310 #if defined( GLS_DEBUG )
311 #pragma BullseyeCoverage save off
316 inline GlsBool GlsGLBlendFuncSFactorIsValid(
const GLenum sfactor )
318 return( ( GL_ZERO == sfactor ) || ( GL_ONE == sfactor ) ||
319 ( GL_DST_COLOR == sfactor ) || ( GL_ONE_MINUS_DST_COLOR == sfactor ) ||
320 ( GL_SRC_ALPHA == sfactor ) || ( GL_ONE_MINUS_SRC_ALPHA == sfactor ) ||
321 ( GL_DST_ALPHA == sfactor ) || ( GL_ONE_MINUS_DST_ALPHA == sfactor ) ||
322 ( GL_SRC_ALPHA_SATURATE == sfactor ) );
324 #pragma BullseyeCoverage restore
327 #if defined( GLS_DEBUG )
328 #pragma BullseyeCoverage save off
333 inline GlsBool GlsGLBlendFuncDFactorIsValid(
const GLenum dfactor )
335 return( ( GL_ZERO == dfactor ) || ( GL_ONE == dfactor ) ||
336 ( GL_SRC_COLOR == dfactor ) || ( GL_ONE_MINUS_SRC_COLOR == dfactor ) ||
337 ( GL_SRC_ALPHA == dfactor ) || ( GL_ONE_MINUS_SRC_ALPHA == dfactor ) ||
338 ( GL_DST_ALPHA == dfactor ) || ( GL_ONE_MINUS_DST_ALPHA == dfactor ) );
340 #pragma BullseyeCoverage restore
343 #if defined( GLS_DEBUG )
344 #pragma BullseyeCoverage save off
349 inline GlsBool GlsGLDepthFuncIsValid(
const GLenum func )
351 return( ( GL_NEVER == func ) || ( GL_LESS == func ) || ( GL_LEQUAL == func ) ||
352 ( GL_EQUAL == func ) || ( GL_GREATER == func ) || ( GL_NOTEQUAL == func ) ||
353 ( GL_GEQUAL == func ) || ( GL_ALWAYS == func ) );
355 #pragma BullseyeCoverage restore
358 #if defined( GLS_DEBUG )
359 #pragma BullseyeCoverage save off
364 inline GlsBool GlsGLShadeModelIsValid(
const GLenum mode )
366 return( ( GL_FLAT == mode ) || ( GL_SMOOTH == mode ) );
368 #pragma BullseyeCoverage restore
371 #if defined( GLS_DEBUG )
372 #pragma BullseyeCoverage save off
377 inline GlsBool GlsGLTetxureEnvModeIsValid(
const GLint mode )
379 return( ( GL_MODULATE == mode ) || ( GL_DECAL == mode ) ||
380 ( GL_BLEND == mode ) || ( GL_REPLACE == mode ) );
382 #pragma BullseyeCoverage restore
385 #if defined( GLS_DEBUG )
386 #pragma BullseyeCoverage save off
391 inline GlsBool GlsGLTextureParameterIsValid(
const GLenum pname )
393 return( ( GL_TEXTURE_MIN_FILTER == pname ) || ( GL_TEXTURE_MAG_FILTER == pname ) ||
394 ( GL_TEXTURE_WRAP_S == pname ) || ( GL_TEXTURE_WRAP_T == pname ) );
396 #pragma BullseyeCoverage restore
399 #if defined( GLS_DEBUG )
400 #pragma BullseyeCoverage save off
405 inline GlsBool GlsGLTextureMinFilterIsValid(
const GLint param )
407 return( ( GL_NEAREST == param ) || ( GL_LINEAR == param ) ||
408 ( GL_NEAREST_MIPMAP_NEAREST == param ) || ( GL_LINEAR_MIPMAP_NEAREST == param ) ||
409 ( GL_NEAREST_MIPMAP_LINEAR == param ) || ( GL_LINEAR_MIPMAP_LINEAR == param ) );
411 #pragma BullseyeCoverage restore
414 #if defined( GLS_DEBUG )
415 #pragma BullseyeCoverage save off
420 inline GlsBool GlsGLTextureMagFilterIsValid(
const GLint param )
422 return( ( GL_NEAREST == param ) || ( GL_LINEAR == param ) );
424 #pragma BullseyeCoverage restore
427 #if defined( GLS_DEBUG )
428 #pragma BullseyeCoverage save off
433 inline GlsBool GlsGLTextureWrapIsValid(
const GLint param )
435 return( ( GL_CLAMP == param ) || ( GL_REPEAT == param ) );
437 #pragma BullseyeCoverage restore
440 #if defined( GLS_DEBUG )
441 #pragma BullseyeCoverage save off
446 inline GlsBool GlsGLPolygonModeIsValid(
const GLenum mode )
448 return( ( GL_POINT == mode ) || ( GL_LINE == mode ) || ( GL_FILL == mode ) );
450 #pragma BullseyeCoverage restore
453 #endif // _GLS_STATE_MANAGER_H
GlsBool _alphaBlend
Definition: gls_state_manager.h:250
void EnableDepthTest(const GlsBool enable)
Definition: gls_state_manager.h:63
GlsBool _texture2D
Definition: gls_state_manager.h:265
void EnableAlphaTest(const GlsBool enable)
void AlphaFunc(const GLenum func, const GLclampf ref)
void Color(const GlsColor &color)
void EnableCullFace(const GlsBool enable)
void EnableTexture2D(const GlsBool enable)
This header defines a GLS_DEBUG only macro for facilitating evaluating class invariants in the GL Stu...
GlsColor _color
Definition: gls_state_manager.h:263
static GlsStateManager & GetStateManager(void)
void EnableBlend(const GlsBool enable)
unsigned int GlsUInt32
Definition: gls_types.h:73
GLenum _depthFunc
Definition: gls_state_manager.h:255
This header defines any preprocessor defines needed to configure the GL Studio DO-178B Runtime Librar...
void TexEnvi(const GLint param)
GLenum _alphaFunc
Definition: gls_state_manager.h:246
virtual ~GlsStateManager()
void BindTexture2D(const GLuint textureIndex)
GLuint _textureIndex2D
Definition: gls_state_manager.h:267
static const GLuint INVALID_GL_TEXTURE_INDEX
Definition: gls_state_manager.h:74
#define GLS_CLASS_INVARIANT_DECLARATION(ClassName)
Definition: gls_class_invariant.h:80
void BlendFunc(const GLenum sfactor, const GLenum dfactor)
GLenum _shadeModel
Definition: gls_state_manager.h:261
GlsBool _lineSmooth
Definition: gls_state_manager.h:257
bool GlsBool
Definition: gls_types.h:96
int GlsInt32
Definition: gls_types.h:66
GlsBool _cullFace
Definition: gls_state_manager.h:259
GLenum _alphaBlendDFactor
Definition: gls_state_manager.h:252
void LineWidth(const GLfloat lineWidth)
GlsBool _alphaTest
Definition: gls_state_manager.h:248
This header includes the API for the OpenGL provider used in the GL Studio DO-178B Runtime Library...
GLfloat _lineWidth
Definition: gls_state_manager.h:270
void Begin(const GLenum mode)
This header defines a 4 component RGBA color for use in the GL Studio DO-178B Runtime Library...
GLenum _polygonMode
Definition: gls_state_manager.h:272
void DepthFunc(const GLenum func)
Definition: gls_color.h:47
GLclampf _alphaRef
Definition: gls_state_manager.h:247
void EnableLineSmooth(const GlsBool enable)
void ResetOpenGLState(void)
void ShadeModel(const GLenum mode)
GLenum _alphaBlendSFactor
Definition: gls_state_manager.h:251
void TexParameteri2D(const GLenum pname, const GLint param)
GlsBool _depthTest
Definition: gls_state_manager.h:254