GL Studio C++ Runtime API
|
#include <component_light_mgr.h>
Public Member Functions | |
void | UseParentsLighting (bool useParentsLighting) |
bool | UseParentsLighting () |
void | EnableNormalize (bool enableNormalize) |
bool | EnableNormalize () |
void | RegisterLight (GlsLightSource *light) |
void | ClearRegisteredLights () |
void | TopFrameInitialize () |
void | TopFrameRestore () |
void | SetupComponentLighting () |
void | CleanupComponentLighting () |
void | SetupLighting (DisplayObject *object) |
void | ReapplyLightsForEyePoint (GlsEyePoint *eyePoint) |
void | ReapplyLights () |
bool * | GetActiveLightsMask () |
unsigned int | GetActiveLightsBitMask () |
unsigned int | GetNumActiveLights () |
Static Public Member Functions | |
static ComponentLightMgr * | CreateInstance () |
Protected Attributes | |
DynamicArray< GlsLightSource * > | _registeredLights |
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.
void CleanupComponentLighting | ( | ) |
Called at the end of DisplayFrame::Draw() to restore the original lighting state
void ClearRegisteredLights | ( | ) |
Called before PreDraw() to clear the light list
|
static |
bool EnableNormalize | ( | ) |
Accessor method to get whether or not GL_NORMALIZE is enabled
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 | ( | ) |
Get a bitmask of the active lights
bool * GetActiveLightsMask | ( | ) |
Get a boolean mask of the active lights
unsigned int GetNumActiveLights | ( | ) |
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, reapplies the lights with their original modelview.
eyePoint | The new GlsEyePoint to use, or NULL. |
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 | ( | ) |
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 | ( | ) |
Called by the the parent of the component to initialize lighting prior to drawing the component
void TopFrameRestore | ( | ) |
Called by the the parent of the component to restore lighting after drawing the component
bool UseParentsLighting | ( | ) |
Accessor method to get whether or not to inherit lighting from the component's parent
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 |
|
protected |
List of active lights in the component. This list is reset and populated during the PreDraw() traversal
|
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.