Class AWTGLCanvas

java.lang.Object
java.awt.Component
java.awt.Canvas
icyllis.modernui.core.awt.AWTGLCanvas
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public abstract class AWTGLCanvas extends Canvas
An AWT Canvas that supports to be drawn on using OpenGL.
See Also:
  • Field Details

    • platformCanvas

      protected PlatformGLCanvas platformCanvas
    • context

      protected long context
    • data

      protected final GLData data
    • effective

      protected final GLData effective
    • initCalled

      protected boolean initCalled
  • Constructor Details

    • AWTGLCanvas

      protected AWTGLCanvas(GLData data)
    • AWTGLCanvas

      protected AWTGLCanvas()
  • Method Details

    • removeNotify

      public void removeNotify()
      Overrides:
      removeNotify in class Component
    • addComponentListener

      public void addComponentListener(ComponentListener l)
      Overrides:
      addComponentListener in class Component
    • disposeCanvas

      public void disposeCanvas()
    • beforeRender

      protected void beforeRender()
    • afterRender

      protected void afterRender()
    • executeInContext

      public <T> T executeInContext(Callable<T> callable) throws Exception
      Throws:
      Exception
    • runInContext

      public void runInContext(Runnable runnable)
    • render

      public void render()
    • initGL

      public abstract void initGL()
      Will be called once after the OpenGL has been created.
    • paintGL

      public abstract void paintGL()
      Will be called whenever the Canvas needs to paint itself.
    • getFramebufferWidth

      public int getFramebufferWidth()
    • getFramebufferHeight

      public int getFramebufferHeight()
    • swapBuffers

      public final void swapBuffers()
    • getGraphics

      public Graphics getGraphics()
      Returns Graphics object that ignores Graphics.clearRect(int, int, int, int) calls. This is done so that the frame buffer will not be cleared by AWT/Swing internals.
      Overrides:
      getGraphics in class Component