Class TextureSurface
- All Implemented Interfaces:
AutoCloseable,Closeable
Surface which renders to a Texture instead of to the default frame buffer.
Note: a TextureSurface makes use of three GPU resources: a framebuffer, a quad batch
and a texture. The framebuffer's lifecycle is tied to the lifecycle of the
TextureSurface. When you close() it the framebuffer is disposed.
The quad batch's lifecycle is independent of the TextureSurface. Most likely you will
use the default quad batch for your game which lives for the lifetime of your game.
The texture's lifecycle is also independent of the TextureSurface and is managed by
reference counting. The texture is neither referenced, nor released by the
TextureSurface. It is assumed that the texture will be stuffed into an ImageLayer or
used for rendering elsewhere and that code will manage the texture's lifecycle (even if the
texture is created by TextureSurface in the first place).
-
Nested Class Summary
Nested classes/interfaces inherited from interface react.Closeable
Closeable.Set, Closeable.Util -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTextureSurface(Graphics gfx, QuadBatch defaultBatch, float width, float height) Creates a texture surface which iswidth x heightin display units.TextureSurface(Graphics gfx, QuadBatch defaultBatch, Texture texture) Creates a texture surface which renders totexture. -
Method Summary
Methods inherited from class playn.core.Surface
alpha, begin, clear, clear, combineTint, concatenate, draw, draw, draw, draw, draw, drawCentered, drawLine, drawLine, end, endClipped, fillRect, intersects, popBatch, preConcatenate, pushBatch, restoreTx, rotate, saveTx, scale, setAlpha, setCheckIntersection, setFillColor, setFillPattern, setTint, startClipped, tint, transform, translate, tx
-
Field Details
-
texture
The texture into which we're rendering.
-
-
Constructor Details
-
TextureSurface
Creates a texture surface which iswidth x heightin display units. A managed backing texture will be automatically created. -
TextureSurface
Creates a texture surface which renders totexture.
-
-
Method Details