GL Studio C++ Runtime API
IGlsStateManagerES20 Interface Referenceabstract

#include <gls_state_manager_es20_interface.h>

Inheritance diagram for IGlsStateManagerES20:
IGlsStateManager NonCopyable

Classes

struct  gl_LightSourceParameters
 

Public Member Functions

virtual GlsMatrixTypeGetTopModelViewMatrix ()=0
 
virtual GlsMatrixTypeGetTopProjMatrix ()=0
 
virtual void TangentArrayEnabled (bool val)=0
 
virtual void BinormalArrayEnabled (bool val)=0
 
virtual void TangentPointer (GLenum type, GLsizei stride, const GLvoid *pointer)=0
 
virtual void BinormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer)=0
 
virtual void AlphaBlendFuncSeparate (GLenum srcColor, GLenum dstColor, GLenum srcAlpha, GLenum dstAlpha)=0
 
virtual void AlphaBlendFunc (GLenum src, GLenum dst)=0
 
virtual void PushAlphaBlendFunc ()=0
 Push the current alpha blend function on the stack. More...
 
virtual void PopAlphaBlendFunc ()=0
 Pop the current alpha blend function off the stack. More...
 
virtual gl_LightSourceParametersGetLightSourceParameters (unsigned int index)=0
 
virtual void PushCustomShaderProgram (GlsEffect *effect, const GLboolean useProgramImmediately)=0
 
virtual void PopCustomShaderProgram ()=0
 
virtual bool HasCustomShader () const =0
 
virtual void UpdateShaderProgram (const GLboolean forceUpdate)=0
 
virtual void UpdateShaderAttributes ()=0
 
virtual void UpdateShaderUniforms ()=0
 
- Public Member Functions inherited from IGlsStateManager
virtual void AlphaBlendFuncSeparate (GLenum srcColor, GLenum dstColor, GLenum srcAlpha, GLenum dstAlpha)=0
 
virtual void SetDefaultAlphaBlendFunc ()=0
 Sets the default blend function for GL Studio.
 
virtual void PushAlphaBlendFunc ()=0
 Pushes the current alpha blend func onto an internal stack. Can restore the pushed alpha blend func by calling PopAlphaBlendFunc. More...
 
virtual void PopAlphaBlendFunc ()=0
 Pops the previously pushed alpha blend func from the stack and restores its state to the opengl context. More...
 
virtual void AlphaBlendFunc (GLenum src, GLenum dst)=0
 
virtual void SetDefaultState (bool forceResetUnmanagedState=false)=0
 
virtual void LoadProjectionMatrixf (const GlsMatrixType &m)=0
 
virtual void LoadProjectionIdentityMatrix ()=0
 
virtual void PushProjectionMatrix ()=0
 
virtual void PopProjectionMatrix ()=0
 
virtual void LoadModelViewMatrixf (const GlsMatrixType &m)=0
 
virtual void LoadModelViewIdentityMatrix ()=0
 Set the current model view matrix to the identity matrix.
 
virtual void MultModelViewMatrixf (const GlsMatrixType &m, const GLboolean pushMatrix)=0
 
virtual void TranslateModelViewMatrixf (GLfloat x, GLfloat y, GLfloat z)=0
 
virtual void PushModelViewMatrix ()=0
 
virtual void PopModelViewMatrix ()=0
 
virtual void LoadTextureMatrixf (const GlsMatrixType &m)=0
 
virtual void LoadTextureIdentityMatrix ()=0
 Sets the current texture matrix to the identity matrix.
 
virtual void ScaleTextureMatrixf (GLfloat x, GLfloat y, GLfloat z)=0
 
virtual void TranslateTextureMatrixf (GLfloat x, GLfloat y, GLfloat z)=0
 
virtual void PushTextureMatrix ()=0
 
virtual void PopTextureMatrix ()=0
 
virtual void AlphaBlendEnabled (bool val)=0
 
virtual void AlphaTestEnabled (bool val)=0
 
virtual void AlphaTestFunc (GLenum func, GLfloat val)=0
 
virtual void DepthTestEnabled (bool val)=0
 
virtual void DepthMaskEnabled (bool val)=0
 
virtual bool IsDepthMaskEnabled ()=0
 
virtual void DepthFunc (GLenum func)=0
 
virtual void DepthRange (GLfloat min, GLfloat max)=0
 
virtual void BackfaceCullingEnabled (bool val)=0
 
virtual void Texture2DEnabled (bool val)=0
 
virtual void ActiveTexture (GLenum textureUnit)=0
 
virtual void BindTexture (IFontImage *texture)=0
 
virtual void DeleteTexture (IFontImage *texture)=0
 
virtual void SetTextureWrapS (GLenum mode)=0
 
virtual void SetTextureWrapT (GLenum mode)=0
 
virtual void SetTextureEnvMode (GLenum mode)=0
 
virtual void SetTextureBlendColor (GLfloat *color)=0
 
virtual void SetTextureMinFilter (GLenum mode)=0
 
virtual void SetTextureMagFilter (GLenum mode)=0
 
virtual void BindIndexBuffer (unsigned int handle)=0
 
virtual void BindVertexBuffer (unsigned int handle)=0
 
virtual void VertexArrayEnabled (bool val)=0
 
virtual void NormalArrayEnabled (bool val)=0
 
virtual void TextureArrayEnabled (bool val)=0
 
virtual void ColorArrayEnabled (bool val)=0
 
virtual void VertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)=0
 
virtual void TexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)=0
 
virtual void NormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer)=0
 
virtual void ColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer)=0
 
virtual void LineSmoothEnabled (bool val)=0
 
virtual void LineWidth (float width)=0
 
virtual float GetMaximumLineWidth ()=0
 
virtual void PointSize (float size)=0
 
virtual void LineStipple (unsigned short pattern, unsigned int multiplier)=0
 
virtual void SetColor (const glsColor &color)=0
 
virtual void Normal3f (float x, float y, float z)=0
 
virtual void AmbientMaterial (const glsColor &color)=0
 
virtual void DiffuseMaterial (const glsColor &color)=0
 
virtual void SpecularMaterial (const glsColor &color)=0
 
virtual void EmissionMaterial (const glsColor &color)=0
 
virtual void ShininessMaterial (float shininess)=0
 
virtual void LightingEnabled (bool val)=0
 
virtual void GouraudShadingEnabled (bool val)=0
 
virtual bool IsLightingEnabled ()=0
 
virtual bool IsLightSourceEnabled (unsigned int index)=0
 
virtual unsigned int GetMaxNumLights ()=0
 
virtual void SetLightEnabled (unsigned int index, bool enabled)=0
 
virtual void SetLightAmbientColor (unsigned int index, GLfloat *color)=0
 
virtual void GetLightAmbientColor (unsigned int index, GLfloat *color)=0
 
virtual void SetLightDiffuseColor (unsigned int index, GLfloat *color)=0
 
virtual void GetLightDiffuseColor (unsigned int index, GLfloat *color)=0
 
virtual void SetLightSpecularColor (unsigned int index, GLfloat *color)=0
 
virtual void GetLightSpecularColor (unsigned int index, GLfloat *color)=0
 
virtual void SetLightPosition (unsigned int index, GLfloat *position)=0
 
virtual void GetLightPosition (unsigned int index, GLfloat *position)=0
 
virtual void SetSpotlightDirection (unsigned int index, GLfloat *direction)=0
 
virtual void GetSpotlightDirection (unsigned int index, GLfloat *direction)=0
 
virtual void SetSpotlightCutoff (unsigned int index, GLfloat cutoff)=0
 
virtual GLfloat GetSpotlightCutoff (unsigned int index)=0
 
virtual void SetSpotlightExponent (unsigned int index, GLfloat exponent)=0
 
virtual GLfloat GetSpotlightExponent (unsigned int index)=0
 
virtual void SetLightAttenuation (unsigned int index, GLfloat constant, GLfloat linear, GLfloat quadratic)=0
 
virtual void GetLightAttenuation (unsigned int index, GLfloat &constant, GLfloat &linear, GLfloat &quadratic)=0
 
virtual unsigned int GetMaxClipPlanes ()=0
 
virtual void ClipPlanef (unsigned int index, float *equation)=0
 
virtual void GetClipPlanef (unsigned int index, float *equation)=0
 
virtual void EnableClipPlane (unsigned int index)=0
 
virtual void DisableClipPlane (unsigned int index)=0
 
virtual bool IsClipPlaneEnabled (unsigned int index)=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

 IGlsStateManagerES20 ()
 
 ~IGlsStateManagerES20 ()
 
- Protected Member Functions inherited from IGlsStateManager
 IGlsStateManager ()
 
virtual ~IGlsStateManager ()
 

Additional Inherited Members

- Public Types inherited from IGlsStateManager
enum  { GLS_TEXTURE_MAP_MODE_MODULATE = 0x2100 , GLS_TEXTURE_MAP_MODE_DECAL = 0x2101 , GLS_TEXTURE_MAP_MODE_BLEND = 0x0BE2 , GLS_TEXTURE_MAP_MODE_REPLACE = 0x1E01 }
 Supported texture mapping modes.
 
enum  { MATRIX_STACK_DEPTH = 64u , PROJECTION_STACK_DEPTH = 64u , TEXTURE_STACK_DEPTH = 64u , CUSTOM_SHADER_PROGRAM_STACK_DEPTH = 64u }
 

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, and has support for managing shaders.

Constructor & Destructor Documentation

◆ IGlsStateManagerES20()

IGlsStateManagerES20 ( )
inlineprotected

empty ctor

◆ ~IGlsStateManagerES20()

~IGlsStateManagerES20 ( )
inlineprotected

empty dtor

Member Function Documentation

◆ AlphaBlendFunc()

virtual void AlphaBlendFunc ( GLenum  src,
GLenum  dst 
)
pure virtual

Set the alpha blend function.

Parameters
srcFunction to use for source color.
dstFunction to use for destination color.

Implements IGlsStateManager.

◆ AlphaBlendFuncSeparate()

virtual void AlphaBlendFuncSeparate ( GLenum  srcColor,
GLenum  dstColor,
GLenum  srcAlpha,
GLenum  dstAlpha 
)
pure virtual

Set the alpha blend function separately for RGB and A channels.

Parameters
srcColorFunction to use for source color.
dstColorFunction to use for destination color.
srcAlphaFunction to use for source alpha.
dstAlphaFunction to use for destination alpha.

Implements IGlsStateManager.

◆ BinormalArrayEnabled()

virtual void BinormalArrayEnabled ( bool  val)
pure virtual

Enable or disable the binormal array vertex attribute.

Parameters
valThe new state flag to set.

◆ BinormalPointer()

virtual void BinormalPointer ( GLenum  type,
GLsizei  stride,
const GLvoid *  pointer 
)
pure virtual

Set the vertex attribute pointer (to underlying data) for the binormal array.

Parameters
typeMust be GL_FLOAT.
strideThe stride in bytes between binormal elements in the vertex data.
pointerThe vertex data.

◆ GetLightSourceParameters()

virtual gl_LightSourceParameters & GetLightSourceParameters ( unsigned int  index)
pure virtual
Returns
The light source paramters for the given light index.
Parameters
indexThe light index whose parameters are to be returned.

◆ GetTopModelViewMatrix()

virtual GlsMatrixType & GetTopModelViewMatrix ( )
pure virtual
Returns
A reference to the top of the modelview matrix stack.

◆ GetTopProjMatrix()

virtual GlsMatrixType & GetTopProjMatrix ( )
pure virtual
Returns
A reference to the top of the projection matrix stack.

◆ HasCustomShader()

virtual bool HasCustomShader ( ) const
pure virtual
Returns
True if there is at least one custom shader on the stack.

◆ PopAlphaBlendFunc()

virtual void PopAlphaBlendFunc ( )
pure virtual

Pop the current alpha blend function off the stack.

Implements IGlsStateManager.

◆ PopCustomShaderProgram()

virtual void PopCustomShaderProgram ( )
pure virtual

Pop the custom shader program stack enabling the next custom shader program on the stack if there is one

Precondition
number of custom shader programs is > 0
Postcondition
the custom shader program stack is popped enabling the next custom shader program on the stack if there is one

◆ PushAlphaBlendFunc()

virtual void PushAlphaBlendFunc ( )
pure virtual

Push the current alpha blend function on the stack.

Implements IGlsStateManager.

◆ PushCustomShaderProgram()

virtual void PushCustomShaderProgram ( GlsEffect effect,
const GLboolean  useProgramImmediately 
)
pure virtual

Enable the given custom shader program and push it to the top of the custom shader program stack

Parameters
effectcustom shader program
useProgramImmediatelyGL_TRUE if custom shader program should immediately be set as the active shader program else GL_FALSE to allow the state manager to set the program active when it is needed
Precondition
number of custom shader programs is < CUSTOM_SHADER_PROGRAM_STACK_DEPTH
Postcondition
the given custom shader program is at the top of the custom shader program stack and is enabled, it is set to the current active shader program if useProgramImmediately is GL_TRUE

◆ TangentArrayEnabled()

virtual void TangentArrayEnabled ( bool  val)
pure virtual

Enable or disable the tangent array vertex attribute.

Parameters
valThe new state flag to set.

◆ TangentPointer()

virtual void TangentPointer ( GLenum  type,
GLsizei  stride,
const GLvoid *  pointer 
)
pure virtual

Set the vertex attribute pointer (to underlying data) for the tangent array.

Parameters
typeMust be GL_FLOAT.
strideThe stride in bytes between tangent elements in the vertex data.
pointerThe vertex data.

◆ UpdateShaderAttributes()

virtual void UpdateShaderAttributes ( )
pure virtual

Update the attributes for the current shader as needed

Precondition
none
Postcondition
Appropriate attributes for the current shader are updated

◆ UpdateShaderProgram()

virtual void UpdateShaderProgram ( const GLboolean  forceUpdate)
pure virtual

Select the appropriate shader program based on the current settings and update the current shader program if needed

Parameters
forceUpdateGL_TRUE to force uniforms to be updated as if shader program changed
Precondition
none
Postcondition
appropriate shader program based on the current settings is active

◆ UpdateShaderUniforms()

virtual void UpdateShaderUniforms ( )
pure virtual

Update the uniforms for the current shader as needed

Precondition
none
Postcondition
Appropriate uniforms for the current shader are updated

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