| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# 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.
| csGLStateCache (csGLExtensionManager *extmgr)
GLuint | GetBufferARB (GLenum target)
int | GetCurrentTU ()
| Query active texture unit.
GLuint | GetTexture (GLenum, int unit)
GLuint | GetTexture (GLenum)
void | SetBufferARB (GLenum target, GLuint id)
void | SetContext (csGLStateCacheContext *context)
void | SetCurrentTU (int unit)
| Select the currently active texture unit.
void | SetTexture (GLenum target, GLuint texture)
## Public Attributes
csGLStateCacheContext * | currentContext
csGLExtensionManager * | extmgr
| GLenum
| GLint
| GLsizei
| VertexPointer
GLvoid | vpointer
| vsize
| vstride
| vtype
## 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 605 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 736 of file glstates.h.

References GL_TEXTURE0_ARB.

int csGLStateCache::GetCurrentTU | ( |  | ) | `[inline]`

Query active texture unit.

Definition at line 710 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 705 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 717 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 719 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 715 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 728 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 721 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 726 of file glstates.h.

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

- csplugincommon/opengl/glstates.h