GL Studio C++ Runtime API
IGlsStateManager Interface Referenceabstract

#include <gls_state_manager_interface.h>

Inheritance diagram for IGlsStateManager:
NonCopyable IGlsStateManagerES20

Public Types

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 }
 

Public Member Functions

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

 IGlsStateManager ()
 
virtual ~IGlsStateManager ()
 

Friends

class ScopedPtr< 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

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

Constructor & Destructor Documentation

◆ IGlsStateManager()

IGlsStateManager ( )
inlineprotected

default ctor

◆ ~IGlsStateManager()

virtual ~IGlsStateManager ( )
inlineprotectedvirtual

dtor is protected but virtual so that users cannot delete instances of it, but ScopedPtr can inside GlsGlobals.

Member Function Documentation

◆ ActiveTexture()

virtual void ActiveTexture ( GLenum  textureUnit)
pure virtual

Notifies OpenGL the active texture. All subsequent texture state calls will affect the active texture

Parameters
textureUnitthe texture unit to make active.

◆ AlphaBlendEnabled()

virtual void AlphaBlendEnabled ( bool  val)
pure virtual

Updates OpenGL to enable or disable alpha blending.

Parameters
valIf true, then alpha blend is enabled. Otherwise, it'll disable alpha blend.

◆ AlphaBlendFunc()

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

Wrapper for glBlendFunc. Parameters are equivalent to glBlendFunc.

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

Implemented in IGlsStateManagerES20.

◆ AlphaBlendFuncSeparate()

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

Wrapper for glBlendFuncSeparate if supported, or glBlendFunc (ignoring the last two parameters) if glBlendFuncSeparate is not supported. Parameters are equivalent to glBlendFuncSeparate.

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.

Implemented in IGlsStateManagerES20.

◆ AlphaTestEnabled()

virtual void AlphaTestEnabled ( bool  val)
pure virtual

Enables or disables the shader alpha test. When testing, the fragment shaders will check the transparency of the fragment. If it's nearly invisible, the shader instructions will be discarded and will not update the buffer.

Parameters
valIf true, then the shader alpha test is enabled. Otherwise, it's disabled.

◆ AlphaTestFunc()

virtual void AlphaTestFunc ( GLenum  func,
GLfloat  val 
)
pure virtual

Specifies the alpha comparison function. Fragments may be discarded depending on the outcome of this function comparison.

Parameters
funcDetermines the type of comparison to conduct.
valDetermines the threshold when the comparison passes or not.

◆ AmbientMaterial()

virtual void AmbientMaterial ( const glsColor color)
pure virtual

Updates the ambient material parameter to the new color.

Parameters
colorThe new color to use for the ambient material parameter.

◆ BackfaceCullingEnabled()

virtual void BackfaceCullingEnabled ( bool  val)
pure virtual

Notifies OpenGL to enable or disable backface culling. If enabled, triangles facing away from the camera are not rendered.

Parameters
valIf true, then backface culling is enabled. Otherwise, it's disabled.

◆ BindIndexBuffer()

virtual void BindIndexBuffer ( unsigned int  handle)
pure virtual

Binds the vertex array buffer to an OpenGL context.

Parameters
handleThe handle to map to the OpenGL context.

◆ BindTexture()

virtual void BindTexture ( IFontImage texture)
pure virtual

Binds the given texture to the current active texture unit.

Parameters
texturethe texture to bind to the active texture unit.

◆ BindVertexBuffer()

virtual void BindVertexBuffer ( unsigned int  handle)
pure virtual

Binds the vertex attribute array buffer to an OpenGL context.

Parameters
handleThe handle to map to the OpenGL context.

◆ ClipPlanef()

virtual void ClipPlanef ( unsigned int  index,
float *  equation 
)
pure virtual

Updates the equation of a clip plane. The equation is set in local space and retrieved in eye space. The retrieved value is different from the set value unless the modelview matrix is identity.

Parameters
[in]indexDetermines which plane to access. This must be less than the GetMaxClipPlanes.
[in]equationThe new equation that defines the plane. Four floats are used to define the plane. This is in local space.

◆ ColorArrayEnabled()

virtual void ColorArrayEnabled ( bool  val)
pure virtual

Enables or disables the vertex shader color attribute.

Parameters
valIf true, then the shader color attribute is enabled. Otherwise, it's disabled.

◆ ColorPointer()

virtual void ColorPointer ( GLint  size,
GLenum  type,
GLsizei  stride,
const GLvoid *  pointer 
)
pure virtual

Update the vertex shader's color attribute with the new parameters.

Parameters
sizeThe number of components per generic vertex attribute.
typeThe data type of each component in the array.
strideThe byte offset between consecutive generic vertex attributes.
pointerA pointer to the first component of the first generic vertex attribute in the array.

◆ DeleteTexture()

virtual void DeleteTexture ( IFontImage texture)
pure virtual

Unbinds and deletes the specified texture.

Parameters
texturethe texture to unbind from OpenGL and delete.

◆ DepthFunc()

virtual void DepthFunc ( GLenum  func)
pure virtual

Determines the comparison function to use when performing a depth test.

Parameters
funcDetermines the type of comparison to conduct when performing a depth test.

◆ DepthMaskEnabled()

virtual void DepthMaskEnabled ( bool  val)
pure virtual

Notifies OpenGL to enable or disable writing to the depth buffer.

Parameters
valIf true, then writing to the depth buffer is enabled. Otherwise, it'll be disabled.

◆ DepthRange()

virtual void DepthRange ( GLfloat  min,
GLfloat  max 
)
pure virtual

Specifies a linear mapping of the normalized depth coordinates.

Parameters
minThe mapping of the near clipping plane.
maxThe mapping of the far clipping plane.

◆ DepthTestEnabled()

virtual void DepthTestEnabled ( bool  val)
pure virtual

Updates OpenGL to enable or disable the depth test. The depth test will determine if fragments behind other surfaces should be discarded or not.

Parameters
valIf true, then the depth test is enabled. Otherwise, it'll disable the depth test.

◆ DiffuseMaterial()

virtual void DiffuseMaterial ( const glsColor color)
pure virtual

Updates the diffuse material parameter to the new color.

Parameters
colorThe new color to use for the diffuse material parameter.

◆ DisableClipPlane()

virtual void DisableClipPlane ( unsigned int  index)
pure virtual

Deactivates the plane associated with the specified index.

Parameters
[in]indexDetermines which plane to disable.

◆ DrawArrays()

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.

◆ DrawElements()

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.

◆ EmissionMaterial()

virtual void EmissionMaterial ( const glsColor color)
pure virtual

Updates the emission material parameter to the new color.

Parameters
colorThe new color to use for the emission material parameter.

◆ EnableClipPlane()

virtual void EnableClipPlane ( unsigned int  index)
pure virtual

Activates the plane associated with the specified index.

Parameters
[in]indexDetermines which plane to enable.

◆ GetClipPlanef()

virtual void GetClipPlanef ( unsigned int  index,
float *  equation 
)
pure virtual

Retrieves the clip plane equation. This is retrieved in eye space, which may be different from the setter.

Parameters
[in]indexDetermines which plane to access.
[out]equationThe resulting equation that defines the associated plane is copied to this parameter. There must be four floats.

◆ GetLightAmbientColor()

virtual void GetLightAmbientColor ( unsigned int  index,
GLfloat *  color 
)
pure virtual

Retrieves the ambient color parameter from the specified light source.

Parameters
[in]indexDetermines which light source to access.
[out]colorCopies the ambient color value to this parameter.

◆ GetLightAttenuation()

virtual void GetLightAttenuation ( unsigned int  index,
GLfloat &  constant,
GLfloat &  linear,
GLfloat &  quadratic 
)
pure virtual

Retrieves the light attenuation factors from the specified light.

Parameters
[in]indexDetermines which light source to access.
[out]constantThe constant attenuation factor is written to this parameter.
[out]linearThe linear attenuation factor is written to this parameter.
[out]quadraticThe quadratic attenuation factor is written to this parameter.

◆ GetLightDiffuseColor()

virtual void GetLightDiffuseColor ( unsigned int  index,
GLfloat *  color 
)
pure virtual

Retrieves the diffuse color parameter from the specified light source.

Parameters
[in]indexDetermines which light source to access.
[out]colorCopies the diffuse color value to this parameter.

◆ GetLightPosition()

virtual void GetLightPosition ( unsigned int  index,
GLfloat *  position 
)
pure virtual

Retrieves the position of the specified light source. This is retrieved in eye space. The retrieved value is different than the set value unless the modelview matrix is identity.

Parameters
[in]indexDetermines which light source to access.
[out]positionCopies the position value to this parameter. This is in eye space.

◆ GetLightSpecularColor()

virtual void GetLightSpecularColor ( unsigned int  index,
GLfloat *  color 
)
pure virtual

Retrieves the specular color parameter from the specified light source.

Parameters
[in]indexDetermines which light source to access.
[out]colorCopies the specular color value to this parameter.

◆ GetMaxClipPlanes()

virtual unsigned int GetMaxClipPlanes ( )
pure virtual
Returns
The maximum number of clip planes supported by the current driver.

◆ GetMaximumLineWidth()

virtual float GetMaximumLineWidth ( )
pure virtual
Returns
The implementation-dependent maximum width for aliased lines the current platform supports.

◆ GetMaxNumLights()

virtual unsigned int GetMaxNumLights ( )
pure virtual
Returns
The maximum number of possible lights this platform supports.

◆ GetSpotlightCutoff()

virtual GLfloat GetSpotlightCutoff ( unsigned int  index)
pure virtual
Parameters
[in]indexDetermines which light source to access.
Returns
The light cutoff / maximum spread angle of the light source.

◆ GetSpotlightDirection()

virtual void GetSpotlightDirection ( unsigned int  index,
GLfloat *  direction 
)
pure virtual

Retrieves the light direction of the specified light source. This is retrieved in eye space. The retrieved value is different than the set value unless the modelview matrix is identity.

Parameters
[in]indexDetermines which light source to access.
[out]directionCopies the light direction value to this parameter. This is in eye space.

◆ GetSpotlightExponent()

virtual GLfloat GetSpotlightExponent ( unsigned int  index)
pure virtual
Parameters
[in]indexDetermines which light source to access.
Returns
The light source intensity distribution from the specified light.

◆ GouraudShadingEnabled()

virtual void GouraudShadingEnabled ( bool  val)
pure virtual

Determines if the shading model should be flat or smooth. When smooth, the colors between vertices are interpolated. If flat, then only one color from the vertex is chosen for the surface.

Parameters
valIf true, then it'll use smooth shading. Otherwise, it'll use flat shading.

◆ IsClipPlaneEnabled()

virtual bool IsClipPlaneEnabled ( unsigned int  index)
pure virtual
Parameters
[in]indexDetermines which plane to check.
Returns
True if the plane associated with the specified index is enabled.

◆ IsDepthMaskEnabled()

virtual bool IsDepthMaskEnabled ( )
pure virtual
Returns
True if writing to the depth buffer is enabled. Otherwise, false is returned if it's disabled.

◆ IsLightingEnabled()

virtual bool IsLightingEnabled ( )
pure virtual
Returns
True if lighting is enabled.

◆ IsLightSourceEnabled()

virtual bool IsLightSourceEnabled ( unsigned int  index)
pure virtual
Parameters
indexIndex to the light source to check.
Returns
True if the light source associated with the specified index is enabled.

◆ LightingEnabled()

virtual void LightingEnabled ( bool  val)
pure virtual

Enables or disables lighting.

Parameters
valIf true, then lighting is enabled.

◆ LineSmoothEnabled()

virtual void LineSmoothEnabled ( bool  val)
pure virtual

Enables or disables antialiasing for lines. If enabled, jagged edges will be smoothed out.

Parameters
valIf true, then lines are antialiased.

◆ LineStipple()

virtual void LineStipple ( unsigned short  pattern,
unsigned int  multiplier 
)
pure virtual

Specifies the render pattern for lines.

Parameters
patternDetermines which fragments of a line will be drawn. The default pattern is all 1's.
multiplierSpecifies the 'scale' for each bit in the line pattern. For example, if the multiplier is 2, then the pattern stretches out twice as large. This value is clamped to the range 1 to 256.

◆ LineWidth()

virtual void LineWidth ( float  width)
pure virtual

Determines the width of aliased and antialiased lines. If antialiasing is disabled, the actual width is determined by rounding the nearest integer. The width may be clamped. See GetMaximumLineWidth.

Parameters
widthThe number of pixels to fill across the line. This must be a positive value.

◆ LoadModelViewMatrixf()

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.
Parameters
mThe matrix to push onto the stack.

◆ LoadProjectionIdentityMatrix()

virtual void LoadProjectionIdentityMatrix ( )
pure virtual

Set the current projection matrix to the identity matrix.

Postcondition
The projection matrix becomes the identity matrix.

◆ LoadProjectionMatrixf()

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.
Parameters
mThe matrix to load onto the projeciton matrix.

◆ LoadTextureMatrixf()

virtual void LoadTextureMatrixf ( const GlsMatrixType m)
pure virtual

Load the given matrix to the top of the texture matrix stack.

Precondition
GLMatrixAffineFIsValid( m ).
Postcondition
The given matrix is on the top of the texture matrix stack.
Parameters
mThe matrix to load to the top of the texture matrix stack.

◆ MultModelViewMatrixf()

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.

◆ Normal3f()

virtual void Normal3f ( float  x,
float  y,
float  z 
)
pure virtual

Sets the current normal vector. Passing in a unit length vector is not required.

Parameters
xThe x-axis of the normal vector.
yThe y-axis of the normal vector.
zThe z-axis of the normal vector.

◆ NormalArrayEnabled()

virtual void NormalArrayEnabled ( bool  val)
pure virtual

Enables or disables the vertex shader normal attribute.

Parameters
valIf true, then the shader normal attribute is enabled. Otherwise, it's disabled.

◆ NormalPointer()

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

Update the vertex shader's normal attribute with the new parameters.

Parameters
typeThe data type of each component in the array.
strideThe byte offset between consecutive generic vertex attributes.
pointerA pointer to the first component of the first generic vertex attribute in the array.

◆ PointSize()

virtual void PointSize ( float  size)
pure virtual

Specifies the diameter of rasterized points.

Parameters
sizeDetermines the point diameter. This value must be a positive number.

◆ PopAlphaBlendFunc()

virtual void PopAlphaBlendFunc ( )
pure virtual

Pops the previously pushed alpha blend func from the stack and restores its state to the opengl context.

Implemented in IGlsStateManagerES20.

◆ PopModelViewMatrix()

virtual void PopModelViewMatrix ( )
pure virtual

Pop the matrix stack.

Precondition
Current matrix stack index is > 0u.
Postcondition
Matrix stack is popped.

◆ PopProjectionMatrix()

virtual void PopProjectionMatrix ( )
pure virtual

Removes a projection matrix from the top of the stack.

Precondition
Current projection matrix stack index is > 0u.
Postcondition
Projection matrix stack is popped.

◆ PopTextureMatrix()

virtual void PopTextureMatrix ( )
pure virtual

Pop the texture matrix stack.

Precondition
Current matrix stack index is > 0u.
Postcondition
Matrix stack is popped.

◆ PushAlphaBlendFunc()

virtual void PushAlphaBlendFunc ( )
pure virtual

Pushes the current alpha blend func onto an internal stack. Can restore the pushed alpha blend func by calling PopAlphaBlendFunc.

Implemented in IGlsStateManagerES20.

◆ PushModelViewMatrix()

virtual void PushModelViewMatrix ( )
pure virtual

Push the matrix stack.

Precondition
Current matrix stack index is < ( MATRIX_STACK_DEPTH - 1u ).
Postcondition
Matrix stack is pushed.

◆ PushProjectionMatrix()

virtual void PushProjectionMatrix ( )
pure virtual

Adds a projection matrix to the top of the stack.

Precondition
Current projection matrix stack index is < ( PROJECTION_STACK_DEPTH - 1u ).
Postcondition
Project matrix stack is pushed.

◆ PushTextureMatrix()

virtual void PushTextureMatrix ( )
pure virtual

Push the texture matrix stack.

Precondition
Current matrix stack index is < ( MATRIX_STACK_DEPTH - 1u ).
Postcondition
Matrix stack is pushed.

◆ ScaleTextureMatrixf()

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.

◆ SetColor()

virtual void SetColor ( const glsColor color)
pure virtual

Updates the color for subsequent drawing commands when rendering primitives.

Parameters
colorUpdates the current color with this specified color.

◆ SetDefaultState()

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.

◆ SetLightAmbientColor()

virtual void SetLightAmbientColor ( unsigned int  index,
GLfloat *  color 
)
pure virtual

Sets the ambient color parameter for the specified light source.

Parameters
[in]indexDetermines which light source should have their ambient color updated.
[in]colorThe new color to use. There must be four floats for the RGBA.

◆ SetLightAttenuation()

virtual void SetLightAttenuation ( unsigned int  index,
GLfloat  constant,
GLfloat  linear,
GLfloat  quadratic 
)
pure virtual

Sets the light attenuation factor parameters for the specified light source.

Parameters
[in]indexDetermines which light source should have their attenuation factor updated.
[in]constantSet the new constant factor that is independent from the light distance.
[in]linearSets the new linear attenuation factor.
[in]quadraticSets the new quadratic attenuation factor.

◆ SetLightDiffuseColor()

virtual void SetLightDiffuseColor ( unsigned int  index,
GLfloat *  color 
)
pure virtual

Sets the diffuse color parameter for the specified light source.

Parameters
[in]indexDetermines which light source should have their diffuse color updated.
[in]colorThe new color to use. There must be four floats for the RGBA.

◆ SetLightEnabled()

virtual void SetLightEnabled ( unsigned int  index,
bool  enabled 
)
pure virtual

Sets the specified light source to be active or not.

Parameters
indexIndex to the light source to update.
enabledIf true, then the light source will be activated. Otherwise, it'll be deactivated.

◆ SetLightPosition()

virtual void SetLightPosition ( unsigned int  index,
GLfloat *  position 
)
pure virtual

Sets the light position. This is set in local space.

Parameters
[in]indexDetermines which light source should have their position updated.
[in]positionThe new position in local space. There must be three floats for the XYZ.

◆ SetLightSpecularColor()

virtual void SetLightSpecularColor ( unsigned int  index,
GLfloat *  color 
)
pure virtual

Sets the specular color parameter for the specified light source.

Parameters
[in]indexDetermines which light source should have their specular color updated.
[in]colorThe new color to use. There must be four floats for the RGBA.

◆ SetSpotlightCutoff()

virtual void SetSpotlightCutoff ( unsigned int  index,
GLfloat  cutoff 
)
pure virtual

Specifies the maximum spread angle of the light source.

Parameters
[in]indexDetermines which light source to access.
[in]cutoffThe maximum spread angle. Only values within 90 and 180 are accepted where 180 results in uniform light distribution.

◆ SetSpotlightDirection()

virtual void SetSpotlightDirection ( unsigned int  index,
GLfloat *  direction 
)
pure virtual

Specifies the direction of the light. This is retrieved in eye space. The retrieved value is different than the set value unless the modelview matrix is identity.

Parameters
[in]indexDetermines which light source to access.
[in]directionThe new light direction in local space. There must be three floats for the XYZ.

◆ SetSpotlightExponent()

virtual void SetSpotlightExponent ( unsigned int  index,
GLfloat  exponent 
)
pure virtual

Updates the light source's intensity distribution of the light.

Parameters
[in]indexDetermines which light source to access.
[in]exponentSpecifies the intensity distribution of the light where higher values results in a more focused light source, and 0 resulting in a more uniformed light distribution.

◆ SetTextureBlendColor()

virtual void SetTextureBlendColor ( GLfloat *  color)
pure virtual

Updates the shader to blend the specified color.

Parameters
colorthe new color to blend against.

◆ SetTextureEnvMode()

virtual void SetTextureEnvMode ( GLenum  mode)
pure virtual

Equivalent to calling glTexEnv. This updates the texture environment mode to determine shader functions should run.

Parameters
modeThe type of feature to run. For GLES 2.0, the valid values are GLS_TEXTURE_MAP_MODE_MODULATE, GLS_TEXTURE_MAP_MODE_REPLACE, GLS_TEXTURE_MAP_MODE_BLEND, and GLS_TEXTURE_MAP_MODE_DECAL. Otherwise mode may refer to one of six texture functions: GL_ADD, GL_MODULATE, GL_DECAL, GL_BLEND, GL_REPLACE, or GL_COMBINE. Any other value will disable this feature.

◆ SetTextureMagFilter()

virtual void SetTextureMagFilter ( GLenum  mode)
pure virtual

Specifies the active texture's magnification function whenever the pixel being texture maps to an area less than or equal to one texture element.

Parameters
modeThe function to use when scaling up. Valid values are GL_NEAREST, GL_LINEAR.

◆ SetTextureMinFilter()

virtual void SetTextureMinFilter ( GLenum  mode)
pure virtual

Specifies the active texture's minification function whenever the pixel being textured maps to an area greater than one texture element.

Parameters
modeThe function to use when scaling down. Valid values are GL_NEAREST, GL_LINEAR GL_NEAREST_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, GL_LINEAR_MIPMAP_LINEAR.

◆ SetTextureWrapS()

virtual void SetTextureWrapS ( GLenum  mode)
pure virtual

Determines the horizontal wrapping behavior of the active texture.

Parameters
modeThe type of wrapping behavior. Common ones are clamping and repeat.

◆ SetTextureWrapT()

virtual void SetTextureWrapT ( GLenum  mode)
pure virtual

Determines the vertical wrapping behavior of the active texture.

Parameters
modeThe type of wrapping behavior. Common ones are clamping and repeat.

◆ ShininessMaterial()

virtual void ShininessMaterial ( float  shininess)
pure virtual

Updates the shininess material parameter to the new value.

Parameters
shininessThe new shiny value to use for the material. The higher the value, the shinier the material becomes.

◆ SpecularMaterial()

virtual void SpecularMaterial ( const glsColor color)
pure virtual

Updates the specular material parameter to the new color.

Parameters
colorThe new color to use for the specular material parameter.

◆ TexCoordPointer()

virtual void TexCoordPointer ( GLint  size,
GLenum  type,
GLsizei  stride,
const GLvoid *  pointer 
)
pure virtual

Update the vertex shader's texture coordinates attribute with the new parameters.

Parameters
sizeThe number of components per generic vertex attribute.
typeThe data type of each component in the array.
strideThe byte offset between consecutive generic vertex attributes.
pointerA pointer to the first component of the first generic vertex attribute in the array.

◆ Texture2DEnabled()

virtual void Texture2DEnabled ( bool  val)
pure virtual

Enables or disables textures. When enabled, shaders can leverage the diffuse map.

Parameters
valIf true, then textures are enabled. Otherwise, it's disabled.

◆ TextureArrayEnabled()

virtual void TextureArrayEnabled ( bool  val)
pure virtual

Enables or disables the vertex shader texture coordinates attribute.

Parameters
valIf true, then the shader texture coordinates are enabled. Otherwise, it's disabled.

◆ TranslateModelViewMatrixf()

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.

◆ TranslateTextureMatrixf()

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.

◆ VertexArrayEnabled()

virtual void VertexArrayEnabled ( bool  val)
pure virtual

Enables or disables the vertex shader position attribute.

Parameters
valIf true, then the shader position attribute is enabled. Otherwise, it's disabled.

◆ VertexPointer()

virtual void VertexPointer ( GLint  size,
GLenum  type,
GLsizei  stride,
const GLvoid *  pointer 
)
pure virtual

Update the vertex shader's position attribute with the new parameters.

Parameters
sizeThe number of components per generic vertex attribute.
typeThe data type of each component in the array.
strideThe byte offset between consecutive generic vertex attributes.
pointerA pointer to the first component of the first generic vertex attribute in the array.

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