GL Studio API
|
#include <component_light_mgr.h>
Public Member Functions | |
void | UseParentsLighting (bool useParentsLighting) |
bool | UseParentsLighting (void) |
void | EnableNormalize (bool enableNormalize) |
void | RegisterLight (GlsLightSource *light) |
void | ClearRegisteredLights (void) |
void | TopFrameInitialize (void) |
void | TopFrameRestore (void) |
void | SetupComponentLighting (void) |
void | CleanupComponentLighting (void) |
void | SetupLighting (DisplayObject *object) |
void | ReapplyLightsForEyePoint (GlsEyePoint *eyePoint) |
void | ReapplyLights () |
bool * | GetActiveLightsMask (void) |
unsigned int | GetActiveLightsBitMask (void) |
unsigned int | GetNumActiveLights (void) |
Protected Member Functions | |
ComponentLightMgr (void) | |
Protected Attributes | |
bool | _useParentsLighting |
This class is responsible for keeping track of the lights in a component and setting up lighting for the objects of the component.
|
protected |
If UseParentsLighting is true, the component will add its lights to those already set by it's parent. If false, the component will only use it's own lights.
void CleanupComponentLighting | ( | void | ) |
Called at the end of DisplayFrame::Draw() to restore the original lighting state
void ClearRegisteredLights | ( | void | ) |
Called before PreDraw() to clear the light list
void EnableNormalize | ( | bool | enableNormalize | ) |
Sets whether GL_NORMALIZE is enabled. Default value is true.
enableNormalize | Set GL_NORMALIZE to true or false |
unsigned int GetActiveLightsBitMask | ( | void | ) |
Get a bitmask of the active lights
bool* GetActiveLightsMask | ( | void | ) |
Get a boolean mask of the active lights
unsigned int GetNumActiveLights | ( | void | ) |
Get the number of active lights for this component. Will include parent 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).
void ReapplyLights | ( | ) |
Sets a flag to cause the lights to be reapplied when the next lit object draws. 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.
void ReapplyLightsForEyePoint | ( | GlsEyePoint * | eyePoint | ) |
Called to force all lights to be reapplied based on the modelview specified by the eyePoint. A value of NULL, reapplys the lights with their original modelview.
void RegisterLight | ( | GlsLightSource * | light | ) |
Any light source in the component that wants to be enabled must call this during PreDraw().
light | The light to be enabled |
void SetupComponentLighting | ( | void | ) |
Detemine the OpenGL lighting state for this component and push it onto the global lighting stack (called from DisplayFrame::Draw())
void SetupLighting | ( | DisplayObject * | object | ) |
Called by lit objects to setup lights
object | The object to setup lighting for |
void TopFrameInitialize | ( | void | ) |
Called by the the parent of the component to initialize lighting prior to drawing the component
void TopFrameRestore | ( | void | ) |
Called by the the parent of the component to restore lighting after drawing the component
void UseParentsLighting | ( | bool | useParentsLighting | ) |
Accessor method to set whether or not to inherit lighting from the component's parent
useParentsLighting | Whether or not to inherit lighting from the component's parent |
bool UseParentsLighting | ( | void | ) |
Accessor method to get whether or not to inherit lighting from the component's parent
|
protected |
List of active lights in the component This list is reset and populated during the PreDraw() traversal