GL Studio C++ Runtime API
IGlsStateManager Interface Referenceabstract

#include <gls_state_manager_interface.h>

Inheritance diagram for IGlsStateManager:
NonCopyable IGlsStateManagerES20

Public Types

enum  
 
enum  { MATRIX_STACK_DEPTH = 64u, PROJECTION_STACK_DEPTH = 64u, TEXTURE_STACK_DEPTH = 64u, CUSTOM_SHADER_PROGRAM_STACK_DEPTH = 64u }
 

Public Member Functions

virtual void SetDefaultState (bool forceResetUnmanagedState=false)=0
 
virtual void LoadProjectionMatrixf (const GlsMatrixType &m)=0
 
virtual void LoadModelViewMatrixf (const GlsMatrixType &m)=0
 
virtual void MultModelViewMatrixf (const GlsMatrixType &m, const GLboolean pushMatrix)=0
 
virtual void TranslateModelViewMatrixf (GLfloat x, GLfloat y, GLfloat z)=0
 
virtual void PushModelViewMatrix (void)=0
 
virtual void PopModelViewMatrix (void)=0
 
virtual void LoadTextureMatrixf (const GlsMatrixType &m)=0
 
virtual void ScaleTextureMatrixf (GLfloat x, GLfloat y, GLfloat z)=0
 
virtual void TranslateTextureMatrixf (GLfloat x, GLfloat y, GLfloat z)=0
 
virtual void PushTextureMatrix (void)=0
 
virtual void PopTextureMatrix (void)=0
 
virtual void DrawArrays (const GLenum mode, const GLint first, const GLsizei count)=0
 
virtual void DrawElements (const GLenum mode, const GLsizei count, const GLenum type, const GLvoid *indices)=0
 

Protected Member Functions

 IGlsStateManager (void)
 
 ~IGlsStateManager ()
 

Detailed Description

The interface to a state manager that manages the GL Studio runtime library's use of the OpenGL context, minimizing unnecessary state changes

Member Enumeration Documentation

anonymous enum
Enumerator
MATRIX_STACK_DEPTH 

depth of model view matrix stack

PROJECTION_STACK_DEPTH 

depth of projection matrix stack

TEXTURE_STACK_DEPTH 

depth of texture matrix stack

CUSTOM_SHADER_PROGRAM_STACK_DEPTH 

depth of custom shader stack

anonymous enum

supported texture mapping modes

Constructor & Destructor Documentation

IGlsStateManager ( void  )
inlineprotected

empty ctor

~IGlsStateManager ( )
inlineprotected

empty dtor

Member Function Documentation

virtual void DrawArrays ( const GLenum  mode,
const GLint  first,
const GLsizei  count 
)
pure virtual

equivalent to glDrawArrays call

Parameters
modeprimitive mode to draw ( GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, or GL_TRIANGLES )
firststarting index in the enabled arrays
countthe number of indices to be rendered
Precondition
mode must be GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, or GL_TRIANGLES
first >= 0
Postcondition
(GLES20) updated shader program is selected if needed
primitives are drawn to GL
virtual void DrawElements ( const GLenum  mode,
const GLsizei  count,
const GLenum  type,
const GLvoid *  indices 
)
pure virtual

equivalent to glDrawElements call

Parameters
modeprimitive mode to draw ( GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, or GL_TRIANGLES )
countthe number of elements to be rendered
typeSpecifies the type of the values in indices ( GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT )
indicespointer to the location where the indices are stored else an offset in bytes into the the currently bound element array buffer
Precondition
mode must be GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, or GL_TRIANGLES
type must be GL_UNSIGNED_BYTE or GL_UNSIGNED_SHORT
Postcondition
(GLES20) updated shader program is selected if needed
primitives are drawn to GL
virtual void LoadModelViewMatrixf ( const GlsMatrixType m)
pure virtual

load the given matrix on to the top of the matrix stack

Precondition
GLMatrixAffineFIsValid( m )
Postcondition
the given matrix is on the top of the matrix stack
virtual void LoadProjectionMatrixf ( const GlsMatrixType m)
pure virtual

load the given matrix into the projection matrix

Precondition
GLMatrixAffineFIsValid( m )
Postcondition
the given matrix is the projection matrix
virtual void LoadTextureMatrixf ( const GlsMatrixType m)
pure virtual

load the given matrix on to the top of the texture matrix stack

Precondition
GLMatrixAffineFIsValid( m )
Postcondition
the given matrix is on the top of the texture matrix stack
virtual void MultModelViewMatrixf ( const GlsMatrixType m,
const GLboolean  pushMatrix 
)
pure virtual

Multiply (and optionally push) the top of the stack by the given matrix such that if t is the top of the matrix then t=t*m . If pushMatrix is true then the matrix stack is pushed before the multiplication.

Parameters
mmatrix to multiply by
pushMatrixtrue to push the matrix stack before multiplying
Precondition
GLMatrixAffineFIsValid( m ), current matrix stack index is < ( MATRIX_STACK_DEPTH - 1u ) if pushMatrix is true
Postcondition
the top of the stack is multiplied by the given matrix
virtual void PopModelViewMatrix ( void  )
pure virtual

pop the matrix stack

Precondition
current matrix stack index is > 0u
Postcondition
matrix stack is popped
virtual void PopTextureMatrix ( void  )
pure virtual

pop the texture matrix stack

Precondition
current matrix stack index is > 0u
Postcondition
matrix stack is popped
virtual void PushModelViewMatrix ( void  )
pure virtual

push the matrix stack

Precondition
current matrix stack index is < ( MATRIX_STACK_DEPTH - 1u )
Postcondition
matrix stack is popped
virtual void PushTextureMatrix ( void  )
pure virtual

push the texture matrix stack

Precondition
current matrix stack index is < ( MATRIX_STACK_DEPTH - 1u )
Postcondition
matrix stack is popped
virtual void ScaleTextureMatrixf ( GLfloat  x,
GLfloat  y,
GLfloat  z 
)
pure virtual

apply a scale factor to the top of the texture matrix stack

Parameters
xthe x-coordinate of the scale vector
ythe y-coordinate of the scale vector
zthe z-coordinate of the scale vector
virtual void SetDefaultState ( bool  forceResetUnmanagedState = false)
pure virtual

Initializes the state manager to its default states and then sends that state to the OpenGL context

Parameters
forceResetUnmanagedStateforce the reset of all GL state, even state unmanaged by GL Studio
virtual void TranslateModelViewMatrixf ( GLfloat  x,
GLfloat  y,
GLfloat  z 
)
pure virtual

apply a translation to the top of the model view matrix stack

Parameters
xthe x-coordinate of the translation vector
ythe y-coordinate of the translation vector
zthe z-coordinate of the translation vector
virtual void TranslateTextureMatrixf ( GLfloat  x,
GLfloat  y,
GLfloat  z 
)
pure virtual

apply a translation to the top of the texture matrix stack

Parameters
xthe x-coordinate of the translation vector
ythe y-coordinate of the translation vector
zthe z-coordinate of the translation vector

The documentation for this interface was generated from the following file: