Class GLSurface

java.lang.Object
icyllis.modernui.graphics.GLSurface
All Implemented Interfaces:
AutoCloseable

@Deprecated public final class GLSurface extends Object implements AutoCloseable
Deprecated.
This class represents a framebuffer object. It is used for creation of user-defined framebuffers compared to the default framebuffer, whose object is a collection of attachments, for off-screen rendering or post-processing.

For post-processing, attach this to a set of textures otherwise to render buffers. To output this framebuffer to screen, draw the attached textures or copy the renderbuffer pixels to the default framebuffer that preserved by window graphics context.

Losing the reference of the object will delete the framebuffer and all attachments automatically.

See Also:
  • Field Details

    • NUM_RENDER_TARGETS

      public static final int NUM_RENDER_TARGETS
      Deprecated.
      See Also:
  • Constructor Details

    • GLSurface

      public GLSurface()
      Deprecated.
      Creates a framebuffer.
  • Method Details

    • get

      public int get()
      Deprecated.
    • bind

      public void bind()
      Deprecated.
      Binds this framebuffer object to both draw and read target.
    • bindDraw

      public void bindDraw()
      Deprecated.
    • bindRead

      public void bindRead()
      Deprecated.
    • clearColorBuffer

      public void clearColorBuffer()
      Deprecated.
      Clear the current color buffer set by setDrawBuffer(int) to the color (0,0,0,0). Clear the current depth buffer to 1.0f, and stencil buffer to 0.
    • clearStencilBuffer

      public void clearStencilBuffer()
      Deprecated.
    • setDrawBuffer

      public void setDrawBuffer(int buffer)
      Deprecated.
      Set the color buffer for layout(location = 0) out vec4 fragColor. That means the color buffer index is 0.

      Note that only GL_COLOR_ATTACHMENT[x] or GL_NONE is accepted by a framebuffer object. Values such as GL_FRONT_LEFT, GL_BACK are only accepted by the default framebuffer (reserved by the window).

      Parameters:
      buffer - enum buffer
    • setReadBuffer

      public void setReadBuffer(int buffer)
      Deprecated.
    • getBackingWidth

      public int getBackingWidth()
      Deprecated.
    • getBackingHeight

      public int getBackingHeight()
      Deprecated.
    • getAttachedTexture

      @Nonnull public GLTexture getAttachedTexture(int attachment)
      Deprecated.
      Returns the attached texture with the given attachment point.
      Parameters:
      attachment - specify an attachment point
      Returns:
      the raw ptr to texture
      Throws:
      NullPointerException - attachment is not a texture or detached
    • makeBuffers

      public void makeBuffers(int width, int height, boolean exact)
      Deprecated.
    • close

      public void close()
      Deprecated.
      Specified by:
      close in interface AutoCloseable