Class OGLCanvas<G extends OGLGraphics>

java.lang.Object
java.awt.Component
java.awt.Canvas
com.blackrook.gloop.opengl.OGLCanvas<G>
Type Parameters:
G - the OGLGraphics type.
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class OGLCanvas<G extends OGLGraphics> extends Canvas
A common OpenGL Canvas.
Author:
Matthew Tropiano
See Also:
  • Field Details

    • hints

      protected final com.blackrook.gloop.glfw.GLFWWindowHints hints
    • caps

      protected GLCapabilities caps
    • context

      protected long context
  • Constructor Details

    • OGLCanvas

      public OGLCanvas(com.blackrook.gloop.glfw.GLFWWindowHints hints, OGLSystem<G> system)
      Creates a new canvas suitable for rendering to.
      Parameters:
      hints - the hints for this context's creation. Note that some hints for creating the window itself will have no effect, here.
      system - the rendering system to use for rendering content.
      Throws:
      UnsupportedOperationException - if this canvas can't be created for this platform.
  • Method Details

    • getHints

      public final com.blackrook.gloop.glfw.GLFWWindowHints getHints()
      Returns:
      the GLFWWindowHints used to make this canvas.
    • update

      public final void update(Graphics g)
      Overrides:
      update in class Canvas
    • paint

      public final void paint(Graphics g)
      Overrides:
      paint in class Canvas
    • getSystem

      public OGLSystem<G> getSystem()
      Gets a reference to this canvas's underlying system.
      Returns:
      the system reference.
    • renderSystem

      protected void renderSystem(int width, int height)
      Called when the rendering surface is secured so that rendering can be done to via a rendering system.
      Parameters:
      width - the width of the framebuffer.
      height - the height of the framebuffer.
    • dispose

      public void dispose()
      Destroys this canvas.
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable