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 ActivateTU (uint usage)
 Activate the currently selected TU.
GLuint GetBufferARB (GLenum target)
 Get the currently bound VBO/PBO buffer.
int GetCurrentTU ()
 Query active texture unit.
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 SetCurrentTU (int unit)
 Select the currently active texture unit.
Blend functions

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

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

Static Public Attributes

static const int activateImage = 1 << texServer
 Flag that the active TU should be used for binding textures.
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 activateTexEnable = 1 << texServer
 Flag that the active TU should be used when enabling/disabling texturing.
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 842 of file glstates.h.


Member Function Documentation

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

Activate the currently selected TU.

usage is a combination of UnitTexCoord and UnitImage and specifies, for what the current unit is to be used.

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

Definition at line 974 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 1023 of file glstates.h.

int csGLStateCache::GetCurrentTU (  )  [inline]

Query active texture unit.

Definition at line 948 of file glstates.h.

GLint csGLStateCache::GetNumImageUnits (  )  const [inline]

Query the number of texture image units supported by OpenGL.

Definition at line 1113 of file glstates.h.

GLint csGLStateCache::GetNumTexCoords (  )  const [inline]

Query the number of texture coordinate sets supported by OpenGL.

Definition at line 1115 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 1010 of file glstates.h.

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

Select the currently active texture unit.

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

Definition at line 943 of file glstates.h.


Member Data Documentation

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

Flag that the active TU should be used for binding textures.

Definition at line 955 of file glstates.h.

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

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

Definition at line 957 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 953 of file glstates.h.

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

Flag that the active TU should be used when enabling/disabling texturing.

Definition at line 966 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 959 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 964 of file glstates.h.


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

Generated for Crystal Space 1.4.1 by doxygen 1.7.1