net.java.joglutils.msg.actions
Class GLRenderAction

java.lang.Object
  extended by net.java.joglutils.msg.actions.Action
      extended by net.java.joglutils.msg.actions.GLRenderAction

public class GLRenderAction
extends Action

An action which performs rendering of a scene graph via OpenGL.

When applied to the root of the scene graph, this action does not perform any clearing of the color or depth buffer; this is the responsibility of the caller. The render action pushes, pops, and initializes enough OpenGL state to isolate itself, at least in theory, from any surrounding OpenGL state that the application may have set up. There should in theory be no user-visible OpenGL side effects as a result of rendering with this action.


Constructor Summary
GLRenderAction()
           
 
Method Summary
static void addActionMethod(Class<? extends Node> nodeType, Method m)
          Adds an action method for the given node type to this action.
 void apply(Node node)
          Applies this Action to a particular node.
 float getCurAspectRatio()
          Fetches the current aspect ratio of the viewport this GLRenderAction is rendering into.
static State getDefaultState()
          Returns the default state all instances of this class are initialized with.
 javax.media.opengl.GL getGL()
          Returns the GL instance being used for rendering.
 State getState()
          Returns the global state this action encompasses, which is altered by the nodes the action traverses.
static void render(GLRenderAction action, Node node)
          Action method which dispatches to per-node rendering functionality.
 
Methods inherited from class net.java.joglutils.msg.actions.Action
apply, getPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLRenderAction

public GLRenderAction()
Method Detail

getDefaultState

public static State getDefaultState()
Returns the default state all instances of this class are initialized with.


addActionMethod

public static void addActionMethod(Class<? extends Node> nodeType,
                                   Method m)
Adds an action method for the given node type to this action. This should only be called by developers adding new node types and not desiring to use the standard overriding mechanisms.


getState

public State getState()
Description copied from class: Action
Returns the global state this action encompasses, which is altered by the nodes the action traverses.

Specified by:
getState in class Action

apply

public void apply(Node node)
Description copied from class: Action
Applies this Action to a particular node. This is how operations such as rendering are initiated.

Specified by:
apply in class Action

getGL

public javax.media.opengl.GL getGL()
Returns the GL instance being used for rendering.


getCurAspectRatio

public float getCurAspectRatio()
Fetches the current aspect ratio of the viewport this GLRenderAction is rendering into.


render

public static void render(GLRenderAction action,
                          Node node)
Action method which dispatches to per-node rendering functionality.