com.threerings.opengl.util
Class SimpleRenderable

java.lang.Object
  extended by com.threerings.opengl.util.SimpleRenderable
All Implemented Interfaces:
Compositable, Enqueueable
Direct Known Subclasses:
SimpleOverlay, SimpleTransformable

public abstract class SimpleRenderable
extends Object
implements Compositable, Enqueueable

A base class for renderable objects based on SimpleBatches.


Field Summary
protected  SimpleBatch _batch
          The batch that we submit to the renderer.
protected  GlContext _ctx
          The renderer context.
protected  int _priority
          The priority level of the batch.
protected  RenderQueue _queue
          The queue into which we place our batch.
 
Constructor Summary
protected SimpleRenderable()
          Creates an uninitialized renderable.
  SimpleRenderable(GlContext ctx)
          Creates a new simple renderable.
  SimpleRenderable(GlContext ctx, String queue)
          Creates a new simple renderable.
  SimpleRenderable(GlContext ctx, String queue, int priority)
          Creates a new simple renderable.
  SimpleRenderable(GlContext ctx, String queue, int priority, boolean modifiesColorState, int primitiveCount)
          Creates a new simple renderable.
 
Method Summary
 void composite()
          Adds this object's Dependencys and Enqueueables to the compositor in preparation for rendering.
protected  SimpleBatch createBatch(boolean modifiesColorState, int primitiveCount)
          Creates the batch to draw.
protected  RenderState[] createStates()
          Creates the state set for this object.
protected  void draw()
          Draws the geometry in immediate mode.
 void enqueue()
          Enqueues this object for rendering.
 RenderState[] getStates()
          Returns a reference to the state set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_ctx

protected GlContext _ctx
The renderer context.


_queue

protected RenderQueue _queue
The queue into which we place our batch.


_batch

protected SimpleBatch _batch
The batch that we submit to the renderer.


_priority

protected int _priority
The priority level of the batch.

Constructor Detail

SimpleRenderable

public SimpleRenderable(GlContext ctx)
Creates a new simple renderable.


SimpleRenderable

public SimpleRenderable(GlContext ctx,
                        String queue)
Creates a new simple renderable.

Parameters:
queue - the name of the queue into which we place the batch.

SimpleRenderable

public SimpleRenderable(GlContext ctx,
                        String queue,
                        int priority)
Creates a new simple renderable.

Parameters:
queue - the name of the queue into which we place the batch.
priority - the priority level at which to enqueue the batch.

SimpleRenderable

public SimpleRenderable(GlContext ctx,
                        String queue,
                        int priority,
                        boolean modifiesColorState,
                        int primitiveCount)
Creates a new simple renderable.

Parameters:
queue - the name of the queue into which we place the batch.
priority - the priority level at which to enqueue the batch.
modifiesColorState - if true, invalidate the color state after calling the draw() method.
primitiveCount - the primitive count to report to the renderer.

SimpleRenderable

protected SimpleRenderable()
Creates an uninitialized renderable.

Method Detail

getStates

public RenderState[] getStates()
Returns a reference to the state set.


composite

public void composite()
Description copied from interface: Compositable
Adds this object's Dependencys and Enqueueables to the compositor in preparation for rendering.

Specified by:
composite in interface Compositable

enqueue

public void enqueue()
Description copied from interface: Enqueueable
Enqueues this object for rendering.

Specified by:
enqueue in interface Enqueueable

createBatch

protected SimpleBatch createBatch(boolean modifiesColorState,
                                  int primitiveCount)
Creates the batch to draw.


createStates

protected RenderState[] createStates()
Creates the state set for this object.


draw

protected void draw()
Draws the geometry in immediate mode.