Package playn.core
Class GLBatch
java.lang.Object
playn.core.GLBatch
- All Implemented Interfaces:
AutoCloseable
,Closeable
- Direct Known Subclasses:
TexturedBatch
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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
begin
(float fbufWidth, float fbufHeight, boolean flip) Must be called before this batch is used to accumulate and send drawing commands.void
close()
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
flush()
Sends any accumulated drawing calls to the GPU.
-
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 callsflush()
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 interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-