com.threerings.opengl.renderer
Class CompoundBatch

java.lang.Object
  extended by com.threerings.opengl.renderer.Batch
      extended by com.threerings.opengl.renderer.CompoundBatch
All Implemented Interfaces:
Cloneable

public class CompoundBatch
extends Batch

A batch that renders a list of sub-batches in order.


Field Summary
protected  ArrayList<Batch> _batches
          The sub-batches of this batch.
 
Fields inherited from class com.threerings.opengl.renderer.Batch
depth, key
 
Constructor Summary
CompoundBatch()
          Creates an empty compound batch.
CompoundBatch(Batch... batches)
          Creates a compound batch to render the specified batches.
 
Method Summary
 boolean draw(Renderer renderer)
          Draws this batch using the specified renderer.
 ArrayList<Batch> getBatches()
          Returns a reference to the list of batches to render in order.
 int getPrimitiveCount()
          Returns the number of primitives in this batch (optional; returns zero by default).
 
Methods inherited from class com.threerings.opengl.renderer.Batch
clone, compareKeys
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_batches

protected ArrayList<Batch> _batches
The sub-batches of this batch.

Constructor Detail

CompoundBatch

public CompoundBatch()
Creates an empty compound batch.


CompoundBatch

public CompoundBatch(Batch... batches)
Creates a compound batch to render the specified batches.

Method Detail

getBatches

public ArrayList<Batch> getBatches()
Returns a reference to the list of batches to render in order.


draw

public boolean draw(Renderer renderer)
Description copied from class: Batch
Draws this batch using the specified renderer.

Specified by:
draw in class Batch
Returns:
true if the batch changed the color state, in which case it should be invalidated.

getPrimitiveCount

public int getPrimitiveCount()
Description copied from class: Batch
Returns the number of primitives in this batch (optional; returns zero by default).

Overrides:
getPrimitiveCount in class Batch