com.threerings.opengl.compositor
Class RenderQueue

java.lang.Object
  extended by com.threerings.opengl.compositor.RenderQueue
All Implemented Interfaces:
Comparable<RenderQueue>

public class RenderQueue
extends Object
implements Comparable<RenderQueue>

Stores a group of Batches enqueued for rendering.


Nested Class Summary
static class RenderQueue.Group
          Contains a group of render queues.
protected static class RenderQueue.GroupBatch
          A batch that contains its own RenderQueue.Group.
protected static class RenderQueue.PriorityList
          A list of batches at the same priority level.
protected static class RenderQueue.State
          Represents the saved state of a queue.
 
Field Summary
protected  ArrayList<RenderQueue.GroupBatch> _batches
          The set of group batches.
protected  RenderQueueConfig _config
          The queue configuration.
protected  GlContext _ctx
          The application context.
protected  HashIntMap<RenderQueue.GroupBatch> _groups
          Maps group ids to their batches.
protected  ComparableArrayList<RenderQueue.PriorityList> _lists
          The set of batch lists, sorted by priority.
protected  HashIntMap<RenderQueue.PriorityList> _priorities
          Maps priorities to batch lists.
static String NORMAL_TYPE
          The normal render queue type.
static String OPAQUE
          The name of the opaque queue.
static String OVERLAY
          The name of the overlay queue.
static String TRANSPARENT
          The name of the transparent queue.
 
Constructor Summary
RenderQueue(GlContext ctx, String name)
          Creates a new render queue.
 
Method Summary
 void add(Batch batch)
          Adds a batch to the queue at the default priority.
 void add(Batch batch, int priority)
          Adds a batch to the queue with the specified priority.
 void clear()
          Clears out the contents of the queue.
 int compareTo(RenderQueue other)
           
 RenderQueue.Group getGroup(int group)
          Returns the identified group within this queue.
 boolean isEmpty()
          Determines whether this queue is empty (after sorting).
 void render()
          Renders the contents of the queue.
 void renderLists(Renderer renderer)
          Renders the contents of the lists.
 void sort()
          Sorts the contents of the queue in preparation for rendering.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPAQUE

public static final String OPAQUE
The name of the opaque queue.

See Also:
Constant Field Values

TRANSPARENT

public static final String TRANSPARENT
The name of the transparent queue.

See Also:
Constant Field Values

OVERLAY

public static final String OVERLAY
The name of the overlay queue.

See Also:
Constant Field Values

NORMAL_TYPE

public static final String NORMAL_TYPE
The normal render queue type.

See Also:
Constant Field Values

_ctx

protected GlContext _ctx
The application context.


_config

protected RenderQueueConfig _config
The queue configuration.


_priorities

protected HashIntMap<RenderQueue.PriorityList> _priorities
Maps priorities to batch lists.


_lists

protected ComparableArrayList<RenderQueue.PriorityList> _lists
The set of batch lists, sorted by priority.


_groups

protected HashIntMap<RenderQueue.GroupBatch> _groups
Maps group ids to their batches.


_batches

protected ArrayList<RenderQueue.GroupBatch> _batches
The set of group batches.

Constructor Detail

RenderQueue

public RenderQueue(GlContext ctx,
                   String name)
Creates a new render queue.

Method Detail

add

public void add(Batch batch)
Adds a batch to the queue at the default priority.


add

public void add(Batch batch,
                int priority)
Adds a batch to the queue with the specified priority.


getGroup

public RenderQueue.Group getGroup(int group)
Returns the identified group within this queue.


sort

public void sort()
Sorts the contents of the queue in preparation for rendering.


isEmpty

public boolean isEmpty()
Determines whether this queue is empty (after sorting).


render

public void render()
Renders the contents of the queue.


clear

public void clear()
Clears out the contents of the queue.


renderLists

public void renderLists(Renderer renderer)
Renders the contents of the lists. This is called by the RenderQueueConfig.RenderMode.


compareTo

public int compareTo(RenderQueue other)
Specified by:
compareTo in interface Comparable<RenderQueue>