Package playn.core
Class RenderTarget
java.lang.Object
playn.core.RenderTarget
- All Implemented Interfaces:
AutoCloseable
,Closeable
Encapsulates an OpenGL render target (i.e. a framebuffer).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface react.Closeable
Closeable.Set, Closeable.Util
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
bind()
Binds the framebuffer.void
close()
Deletes the framebuffer associated with this render target.static RenderTarget
Creates a render target that renders totexture
.abstract boolean
flip()
Whether or not to flip the y-axis when rendering to this target.abstract int
height()
The height of the framebuffer in pixels.abstract int
id()
The framebuffer id.toString()
abstract int
width()
The width of the framebuffer in pixels.abstract float
xscale()
The x-scale between display units and pixels for this target.abstract float
yscale()
The y-scale between display units and pixels for this target.
-
Field Details
-
gfx
A handle on our graphics services.
-
-
Constructor Details
-
RenderTarget
-
-
Method Details
-
create
Creates a render target that renders totexture
. -
id
public abstract int id()The framebuffer id. -
width
public abstract int width()The width of the framebuffer in pixels. -
height
public abstract int height()The height of the framebuffer in pixels. -
xscale
public abstract float xscale()The x-scale between display units and pixels for this target. -
yscale
public abstract float yscale()The y-scale between display units and pixels for this target. -
flip
public abstract boolean flip()Whether or not to flip the y-axis when rendering to this target. When rendering to textures we do not want to flip the y-axis, but when rendering to the screen we do (so that the origin is at the upper-left of the screen). -
bind
public void bind()Binds the framebuffer. -
close
public void close()Deletes the framebuffer associated with this render target.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
toString
-