GLState Class Reference

#include <GLState.h>

List of all members.

Public Types

enum  State {
  TEXTURE_ON = 0x1, TEXTURE_OFF = 0x2, BLEND_ON = 0x4,
  BLEND_OFF = 0x8, DEPTH_ON = 0x10, DEPTH_OFF = 0x20,
  CUBEMAP_ON = 0x40, CUBEMAP_OFF = 0x80, NORMALIZE_ON = 0x100,
  NORMALIZE_OFF = 0x200, LIGHTING_ON = 0x400, LIGHTING_OFF = 0x800,
  LIGHT1_ON = 0x1000, LIGHT1_OFF = 0x2000, ALPHATEST_ON = 0x4000,
  ALPHATEST_OFF = 0x8000
}

Public Member Functions

 GLState (unsigned wantedState)
virtual ~GLState ()

Static Public Member Functions

static void setBaseState (unsigned baseState)
static const char * getStateString ()
static unsigned int getState ()
static void setState (unsigned wanted)
static unsigned int getStateSwitches ()
static void resetStateSwitches ()

Protected Attributes

unsigned returnState_

Static Protected Attributes

static unsigned currentState_
static unsigned int stateSwitches_ = 0


Detailed Description

Definition at line 27 of file GLState.h.


Member Enumeration Documentation

enum GLState::State

Enumerator:
TEXTURE_ON 
TEXTURE_OFF 
BLEND_ON 
BLEND_OFF 
DEPTH_ON 
DEPTH_OFF 
CUBEMAP_ON 
CUBEMAP_OFF 
NORMALIZE_ON 
NORMALIZE_OFF 
LIGHTING_ON 
LIGHTING_OFF 
LIGHT1_ON 
LIGHT1_OFF 
ALPHATEST_ON 
ALPHATEST_OFF 

Definition at line 30 of file GLState.h.


Constructor & Destructor Documentation

GLState::GLState ( unsigned  wantedState  ) 

Definition at line 34 of file GLState.cpp.

References currentState_, returnState_, and setState().

GLState::~GLState (  )  [virtual]

Definition at line 42 of file GLState.cpp.

References returnState_, and setState().


Member Function Documentation

void GLState::setBaseState ( unsigned  baseState  )  [static]

Definition at line 203 of file GLState.cpp.

References setState().

Referenced by GLSetup::setup().

const char * GLState::getStateString (  )  [static]

Definition at line 181 of file GLState.cpp.

References addToBuffer(), BLEND_OFF, BLEND_ON, CUBEMAP_OFF, CUBEMAP_ON, DEPTH_OFF, DEPTH_ON, LIGHT1_OFF, LIGHT1_ON, LIGHTING_OFF, LIGHTING_ON, NORMALIZE_OFF, NORMALIZE_ON, TEXTURE_OFF, and TEXTURE_ON.

static unsigned int GLState::getState (  )  [inline, static]

Definition at line 55 of file GLState.h.

References currentState_.

Referenced by addToBuffer(), and ModelRendererMesh::drawVerts().

void GLState::setState ( unsigned  wanted  )  [static]

Definition at line 47 of file GLState.cpp.

References ALPHATEST_OFF, ALPHATEST_ON, BLEND_OFF, BLEND_ON, CUBEMAP_OFF, CUBEMAP_ON, currentState_, DEPTH_OFF, DEPTH_ON, GL_ALPHA_TEST, GL_ASSERT, GL_BLEND, GL_DEPTH_TEST, GL_LIGHT1, GL_LIGHTING, GL_NORMALIZE, GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP_EXT, glDisable(), glEnable(), LIGHT1_OFF, LIGHT1_ON, LIGHTING_OFF, LIGHTING_ON, NORMALIZE_OFF, NORMALIZE_ON, stateSwitches_, TEXTURE_OFF, and TEXTURE_ON.

Referenced by GLGlobalState::GLGlobalState(), GLState(), setBaseState(), GLGlobalState::setState(), and ~GLState().

static unsigned int GLState::getStateSwitches (  )  [inline, static]

Definition at line 58 of file GLState.h.

References stateSwitches_.

Referenced by FrameTimer::draw().

static void GLState::resetStateSwitches (  )  [inline, static]

Definition at line 59 of file GLState.h.

References stateSwitches_.

Referenced by FrameTimer::draw().


Member Data Documentation

unsigned GLState::currentState_ [static, protected]

Initial value:

Definition at line 62 of file GLState.h.

Referenced by getState(), GLState(), and setState().

unsigned int GLState::stateSwitches_ = 0 [static, protected]

Definition at line 63 of file GLState.h.

Referenced by getStateSwitches(), resetStateSwitches(), and setState().

unsigned GLState::returnState_ [protected]

Definition at line 64 of file GLState.h.

Referenced by GLState(), and ~GLState().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:02 2009 for Scorched3D by  doxygen 1.5.3