Package icyllis.modernui.graphics

# 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:
  - Framebuffer Object

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `NUM_RENDER_TARGETS`
  Deprecated.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GLSurface()`
  Deprecated.
  Creates a framebuffer.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `bind()`
  Deprecated.
  Binds this framebuffer object to both draw and read target.
  `void`
  `bindDraw()`
  Deprecated.
  `void`
  `bindRead()`
  Deprecated.
  `void`
  `clearColorBuffer()`
  Deprecated.
  Clear the current color buffer set by `setDrawBuffer(int)` to the color (0,0,0,0).
  `void`
  `clearStencilBuffer()`
  Deprecated.
  `void`
  `close()`
  Deprecated.
  `int`
  `get()`
  Deprecated.
  `GLTexture`
  `getAttachedTexture(int attachment)`
  Deprecated.
  Returns the attached texture with the given attachment point.
  `int`
  `getBackingHeight()`
  Deprecated.
  `int`
  `getBackingWidth()`
  Deprecated.
  `void`
  `makeBuffers(int width, int height, boolean exact)`
  Deprecated.
  `void`
  `setDrawBuffer(int buffer)`
  Deprecated.
  Set the color buffer for `layout(location = 0) out vec4 fragColor`.
  `void`
  `setReadBuffer(int buffer)`
  Deprecated.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### NUM_RENDER_TARGETS

    public static final int NUM_RENDER_TARGETS
    Deprecated.
    See Also:
      - Constant Field Values

- ## 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`