#include <global_light_mgr.h>
|
LightingState | _currentOpenGLState |
| The current OpenGL lighting state.
|
|
LightingState | _currentState |
| This will become the _currentOpenglState when a lit object draws.
|
|
DynamicArray< GlsLightSource * > | _tempOpenGLLights |
| Store temporary light source pointers (only used in InitializeStateFromOpenGL).
|
|
DynamicArray< LightingState > | _lightingStateStack |
| As each component draws it will push it's lighting state on the stack.
|
|
bool | _reapplyLights |
| If true, the lighting state will be recalculated.
|
|
bool | _enableNormalize |
| If true, GL_NORMALIZE will be enabled during lighting.
|
|
bool * | _activeLights |
| An array storing the current on/off state for each light.
|
|
|
static unsigned int | MAX_OPENGL_LIGHTS |
| The value of glGetIntegerv(GL_MAX_LIGHTS);.
|
|
This singleton class is responsible for keeping track of the GlsLightSource objects currently affecting the OpenGL lighting state and changing the state when needed.
◆ LightingState
List of the currently active lights The number of the light is equal to it's array index. (i.e. The light at index 0 is GL_LIGHT0)
◆ EnableNormalize() [1/2]
static bool EnableNormalize |
( |
| ) |
|
|
static |
Get the state of whether GL_NORMALIZE is enabled
- Returns
- Whether or not GL_NORMALIZE is enabled
◆ EnableNormalize() [2/2]
static void EnableNormalize |
( |
bool |
enableNormalize | ) |
|
|
static |
Set whether or not GL_NORMALIZE is enabled
- Parameters
-
enableNormalize | Set GL_NORMALIZE to true or false |
◆ GetActiveLightsBitMask()
unsigned int GetActiveLightsBitMask |
( |
| ) |
|
Get a bitmask of the active lights
- Returns
- An unsigned integer with each bit representing a light turned on/off
◆ GetActiveLightsMask()
bool * GetActiveLightsMask |
( |
| ) |
|
Get a boolean mask of the active lights
- Returns
- A boolean array with a bitmask of the currently active lights
◆ GetLightingState()
Get the current lighting state
- Returns
- The current lighting state
◆ GetNumActiveLights()
unsigned int GetNumActiveLights |
( |
| ) |
|
Get the number of active lights. Really is the max index(+1) of lights that you need to cycle through to have taken all of them into account (in case of holes in the list created by an outside party).
- Returns
- An integer representing the (max) number of currently active lights
◆ GlMaxLights()
static unsigned int GlMaxLights |
( |
| ) |
|
|
inlinestatic |
- Returns
- The value of GL_MAX_LIGHTS
◆ InitializeStateFromOpenGL()
void InitializeStateFromOpenGL |
( |
| ) |
|
Clear the lighting stack, create GlsLightSource objects based on the current OpenGL lighting state and store them as the current state.
◆ Instance()
◆ PopLightingState()
void PopLightingState |
( |
| ) |
|
Push the current lighting state off the stack
◆ PushLightingState()
void PushLightingState |
( |
| ) |
|
Push the current lighting state onto the stack
◆ ReapplyLights()
Flags the need to reapply the lights. This may be necessary for special cases where the OpenGL matrices have changed during a traversel. This can happen when drawing multiple views of the same geometry.
◆ RestoreOpenGLState()
void RestoreOpenGLState |
( |
| ) |
|
◆ SetLightingState() [1/2]
Set the current lighting state to a new state
- Parameters
-
newState | The new lighting state |
◆ SetLightingState() [2/2]
Set the current lighting state to a new state
- Parameters
-
newState | The new lighting state |
◆ SetupLighting()
void SetupLighting |
( |
GlsEyePoint * |
relativeToEyepoint = NULL | ) |
|
Set OpenGL lighting state to match the current state. If relativeToEyepoint is set, the light will be applied using the modelview matrix calculated from the eyepoint to the light.
- Parameters
-
relativeToEyepoint | Optional eyepoint used to calculate modelview matrix to apply with the light. |
◆ GlobalLightMgrThreadMap
friend class GlobalLightMgrThreadMap |
|
friend |
helper class for maintaining one global light mgr per calling thread
The documentation for this class was generated from the following file: