com.threerings.opengl.renderer
Class Batch

java.lang.Object
  extended by com.threerings.opengl.renderer.Batch
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
CompoundBatch, SimpleBatch

public abstract class Batch
extends Object
implements Cloneable

A geometry batch that can be queued for rendering.


Field Summary
 float depth
          The batch's eye space z coordinate (negative if in front of the viewer).
 int[] key
          A comparable representation of the batch's state.
 
Constructor Summary
Batch()
           
 
Method Summary
 Batch clone()
           
static int compareKeys(int[] k1, int[] k2)
          Compares two packed state keys.
abstract  boolean draw(Renderer renderer)
          Draws this batch using the specified renderer.
 int getPrimitiveCount()
          Returns the number of primitives in this batch (optional; returns zero by default).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

depth

public float depth
The batch's eye space z coordinate (negative if in front of the viewer).


key

public int[] key
A comparable representation of the batch's state.

Constructor Detail

Batch

public Batch()
Method Detail

compareKeys

public static int compareKeys(int[] k1,
                              int[] k2)
Compares two packed state keys.


draw

public abstract boolean draw(Renderer renderer)
Draws this batch using the specified renderer.

Returns:
true if the batch changed the color state, in which case it should be invalidated.

getPrimitiveCount

public int getPrimitiveCount()
Returns the number of primitives in this batch (optional; returns zero by default).


clone

public Batch clone()
Overrides:
clone in class Object


Copyright © 2011. All Rights Reserved.