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 TypeMethodDescriptionvoidbind()Binds the framebuffer.voidclose()Deletes the framebuffer associated with this render target.static RenderTargetCreates a render target that renders totexture.abstract booleanflip()Whether or not to flip the y-axis when rendering to this target.abstract intheight()The height of the framebuffer in pixels.abstract intid()The framebuffer id.toString()abstract intwidth()The width of the framebuffer in pixels.abstract floatxscale()The x-scale between display units and pixels for this target.abstract floatyscale()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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
toString
-