Package playn.core

Class RenderTarget

java.lang.Object
playn.core.RenderTarget
All Implemented Interfaces:
AutoCloseable, Closeable

public abstract class RenderTarget extends Object implements 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
    Modifier and Type
    Field
    Description
    final Graphics
    A handle on our graphics services.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Binds the framebuffer.
    void
    Deletes the framebuffer associated with this render target.
    create(Graphics gfx, Texture tex)
    Creates a render target that renders to texture.
    abstract boolean
    Whether or not to flip the y-axis when rendering to this target.
    abstract int
    The height of the framebuffer in pixels.
    abstract int
    id()
    The framebuffer id.
     
    abstract int
    The width of the framebuffer in pixels.
    abstract float
    The x-scale between display units and pixels for this target.
    abstract float
    The y-scale between display units and pixels for this target.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • gfx

      public final Graphics gfx
      A handle on our graphics services.
  • Constructor Details

    • RenderTarget

      public RenderTarget(Graphics gfx)
  • Method Details

    • create

      public static RenderTarget create(Graphics gfx, Texture tex)
      Creates a render target that renders to texture.
    • 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 interface AutoCloseable
      Specified by:
      close in interface Closeable
    • toString

      public String toString()
      Overrides:
      toString in class Object