CrystalSpace

Public API Reference

csGLStateCache Class Reference
[Common Plugin Classes]

OpenGL state cache. More...

#include <csplugincommon/opengl/glstates.h>

List of all members.

Public Member Functions

void ActivateImageUnit ()
 Activate the currently selected image unit.
void ActivateTCUnit (uint usage)
 Activate the currently selected coordinate set.
GLuint GetBufferARB (GLenum target)
 Get the currently bound VBO/PBO buffer.
int GetCurrentImageUnit ()
 Query active image unit.
int GetCurrentTCUnit ()
 Query active texture coordinate set.
GLint GetNumImageUnits () const
 Query the number of texture image units supported by OpenGL.
GLint GetNumTexCoords () const
 Query the number of texture coordinate sets supported by OpenGL.
void SetBufferARB (GLenum target, GLuint id, bool applyNow=false)
 Bind a given VBO/PBO buffer.
void SetCurrentImageUnit (int unit)
 Select the currently active image unit.
void SetCurrentTCUnit (int unit)
 Select the currently active texture coordinate unit.
Blend functions



void GetBlendFunc (GLenum &blend_source, GLenum &blend_destination) const
void GetBlendFuncSeparate (GLenum &blend_sourceRGB, GLenum &blend_destinationRGB, GLenum &blend_sourceA, GLenum &blend_destinationA) const
void SetBlendFunc (GLenum blend_source, GLenum blend_destination, bool forced=false)
void SetBlendFuncSeparate (GLenum blend_sourceRGB, GLenum blend_destinationRGB, GLenum blend_sourceA, GLenum blend_destinationA, bool forced=false)
Clamp control



GLenum GetClampColor (GLenum target) const
void SetClampColor (GLenum target, GLenum clamp)
Pixel storage



GLint GetPixelUnpackAlignment ()
bool GetPixelUnpackSwapBytes ()
void SetPixelUnpackAlignment (GLint alignment)
void SetPixelUnpackSwapBytes (GLint swap)

Static Public Attributes

static const int activateMatrix = 1 << texServer
 Flag that the active TU should be used when changing the texture matrix.
static const int activateTexCoord = 1 << texClient
 Flag that the active TU should be used for setting texture coords.
static const int activateTexEnv = 1 << texServer
 Flag that the active TU should be used when changing the texture environment.
static const int activateTexGen = 1 << texServer
 Flag that the active TU should be used when changing the texture coord generation parameters.

Detailed Description

OpenGL state cache.

All state changes that are made often (possibly with the same value, ie actually no change) or across plugins should be done through the cache.

Remarks:
Since this class is passed directly between plugins the code in this class cannot do memory allocations or deallocations. The functions in this class will only manipulate member variables.

Definition at line 623 of file glstates.h.


Member Function Documentation

void csGLStateCache::ActivateImageUnit (  )  [inline]

Activate the currently selected image unit.

Use this to bind textures.

Remarks:
Doesn't check whether the multitexture extension is actually supported, this must be done in calling code.

Definition at line 744 of file glstates.h.

void csGLStateCache::ActivateTCUnit ( uint  usage  )  [inline]

Activate the currently selected coordinate set.

Remarks:
Doesn't check whether the multitexture extension is actually supported, this must be done in calling code.

Definition at line 789 of file glstates.h.

GLuint csGLStateCache::GetBufferARB ( GLenum  target  )  [inline]

Get the currently bound VBO/PBO buffer.

Remarks:
Doesn't check whether the relevant buffer object extension is actually supported, this must be done in calling code.

Definition at line 838 of file glstates.h.

int csGLStateCache::GetCurrentImageUnit (  )  [inline]

Query active image unit.

Definition at line 734 of file glstates.h.

int csGLStateCache::GetCurrentTCUnit (  )  [inline]

Query active texture coordinate set.

Definition at line 769 of file glstates.h.

GLint csGLStateCache::GetNumImageUnits (  )  const [inline]

Query the number of texture image units supported by OpenGL.

Definition at line 948 of file glstates.h.

GLint csGLStateCache::GetNumTexCoords (  )  const [inline]

Query the number of texture coordinate sets supported by OpenGL.

Definition at line 950 of file glstates.h.

void csGLStateCache::SetBufferARB ( GLenum  target,
GLuint  id,
bool  applyNow = false 
) [inline]

Bind a given VBO/PBO buffer.

Remarks:
Doesn't check whether the relevant buffer object extension is actually supported, this must be done in calling code.

Definition at line 825 of file glstates.h.

void csGLStateCache::SetCurrentImageUnit ( int  unit  )  [inline]

Select the currently active image unit.

Remarks:
Doesn't check whether the multitexture extension is actually supported, this must be done in calling code.

Definition at line 728 of file glstates.h.

void csGLStateCache::SetCurrentTCUnit ( int  unit  )  [inline]

Select the currently active texture coordinate unit.

Use this to change state of texture coordinate arrays, change texture matrices, texture environments, texture coord generation and enabling/disabling textures.

Remarks:
Doesn't check whether the multitexture extension is actually supported, this must be done in calling code.

Definition at line 763 of file glstates.h.


Member Data Documentation

const int csGLStateCache::activateMatrix = 1 << texServer [static]

Flag that the active TU should be used when changing the texture matrix.

Definition at line 776 of file glstates.h.

const int csGLStateCache::activateTexCoord = 1 << texClient [static]

Flag that the active TU should be used for setting texture coords.

Definition at line 774 of file glstates.h.

const int csGLStateCache::activateTexEnv = 1 << texServer [static]

Flag that the active TU should be used when changing the texture environment.

Definition at line 778 of file glstates.h.

const int csGLStateCache::activateTexGen = 1 << texServer [static]

Flag that the active TU should be used when changing the texture coord generation parameters.

Definition at line 783 of file glstates.h.


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

Generated for Crystal Space 2.0 by doxygen 1.6.1