Open Inventor Reference
SoGLLightIdElement Class Reference

Element that stores the id of the current light. More...

#include <Inventor/elements/SoGLLightIdElement.h>

Inheritance diagram for SoGLLightIdElement:
SoInt32Element SoElement

List of all members.

Public Member Functions

virtual void init (SoState *state)
 Initializes element.
virtual void push (SoState *state)
 Overrides push() method to copy values from next instance in the stack.
virtual void pop (SoState *state, const SoElement *prevTopElement)
 Override pop() method so side effects can occur in GL.
virtual void print (FILE *fp) const
 Prints element (for debugging)

Static Public Member Functions

static int increment (SoState *state)
 Increments the current light id.
static int increment (SoState *state, SoNode *)
static int get (SoState *state)
 Returns current light id from the state.
static int getDefault ()
 Returns the default light id.
static int getMaxGLSources ()
 Returns the maximum number of concurrent light sources supported by GL implementation.
static void initClass ()
 Initializes the SoGLLightIdElement class.

Protected Member Functions

virtual ~SoGLLightIdElement ()

Detailed Description

The first light active in a scene has id 0, the next has 1, and so on. This element can be used to determine how many lights are currently active. The initial value of this element is -1 to indicate that there are no lights active.

Note that even though the effects of this element accumulate (each light source increments the id), it is derived from SoInt32Element. This is because each call to increment() effectively does a "get" of the current top instance, so caching knows about the dependency of each instance on the previous one.

Definition at line 79 of file SoGLLightIdElement.h.


Constructor & Destructor Documentation

virtual SoGLLightIdElement::~SoGLLightIdElement ( ) [protected, virtual]

Member Function Documentation

static int SoGLLightIdElement::get ( SoState state) [inline, static]

Definition at line 99 of file SoGLLightIdElement.h.

References SoInt32Element::get().

static int SoGLLightIdElement::getDefault ( ) [inline, static]

Definition at line 103 of file SoGLLightIdElement.h.

static int SoGLLightIdElement::getMaxGLSources ( ) [static]
static int SoGLLightIdElement::increment ( SoState state) [static]

This should be called when a light source becomes active. This returns the new id, or -1 if the maximum number of GL light sources has been exceeded. Otherwise, enables light source.

static int SoGLLightIdElement::increment ( SoState state,
SoNode  
) [inline, static]

Definition at line 94 of file SoGLLightIdElement.h.

References increment().

Referenced by increment().

virtual void SoGLLightIdElement::init ( SoState state) [virtual]

Reimplemented from SoElement.

static void SoGLLightIdElement::initClass ( ) [static]

Reimplemented from SoInt32Element.

virtual void SoGLLightIdElement::pop ( SoState state,
const SoElement prevTopElement 
) [virtual]

Reimplemented from SoElement.

virtual void SoGLLightIdElement::print ( FILE *  fp) const [virtual]

Reimplemented from SoInt32Element.

virtual void SoGLLightIdElement::push ( SoState state) [virtual]

Reimplemented from SoElement.


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