Package playn.core

Class GLBatch

java.lang.Object
playn.core.GLBatch
All Implemented Interfaces:
AutoCloseable, Closeable
Direct Known Subclasses:
TexturedBatch

public abstract class GLBatch extends Object implements Closeable
A batch manages the delivery of groups of drawing calls to the GPU. It is usually a combination of a GLProgram and one or more buffers.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface react.Closeable

    Closeable.Set, Closeable.Util
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    begin(float fbufWidth, float fbufHeight, boolean flip)
    Must be called before this batch is used to accumulate and send drawing commands.
    void
    Releases any GPU resources retained by this batch.
    void
    end()
    Must be called when one is done using this batch to accumulate and send drawing commands.
    void
    Sends any accumulated drawing calls to the GPU.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GLBatch

      public GLBatch()
  • Method Details

    • begin

      public void begin(float fbufWidth, float fbufHeight, boolean flip)
      Must be called before this batch is used to accumulate and send drawing commands.
      Parameters:
      flip - whether or not to flip the y-axis. This is generally true when rendering to the default frame buffer (the screen), and false when rendering to textures.
    • flush

      public void flush()
      Sends any accumulated drawing calls to the GPU. Depending on the nature of the batch, this may be necessary before certain state changes (like switching to a new texture). This should be a NOOP if there's nothing to flush.
    • end

      public void end()
      Must be called when one is done using this batch to accumulate and send drawing commands. The default implementation calls flush() and marks this batch as inactive.
    • close

      public void close()
      Releases any GPU resources retained by this batch. This should be called when the batch will never again be used.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable