Package jgl.wt.awt

Class GLCanvas

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
bezcurve, bezmesh, bezsurf, checker, clip, colormat, cube, doublebuffer, EmulGLCanvas, hello, light, lines, list, material, mipmap, model, movelight, pickdepth, picksquare, planet, polys, quadric, robot, scene, select, simple, smooth, stroke, surface, tea, teapots, texbind, texgen, texsub, texture3d, texturesurf, torus, unproject

public class GLCanvas extends Canvas
GLCanvas is the canvas class of jGL 2.4.
Version:
0.1, 18 Apr 2001
Author:
Robin Bing-Yu Chen
See Also:
  • Field Details

    • myGL

      protected GL myGL
    • myGLU

      protected GLU myGLU
    • myUT

      protected GLUT myUT
  • Constructor Details

    • GLCanvas

      public GLCanvas()
  • Method Details

    • processEvent

      public void processEvent(AWTEvent e)
      This override let GLUT.processEvent(AWTEvent) be informed of AWTEvent traversing this canvas (mouse, keyboard, resize). One should register GLUT.glutDisplayFunc(String) to register a display callback, GLUT.glutMotionFunc(String) to register a mouse motion callback, etc. NB : This relies on the fact the GLUT already invoked
      invalid @link
      {@link this#glut_enable_events
      }.
      Overrides:
      processEvent in class Component
    • glut_enable_events

      public void glut_enable_events(long cap, boolean state)
    • update

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

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

      protected void getPixelScaleFromG2D(Graphics2D g2d)
      Pixel scale is used to model the pixel ratio introduced by HiDPI
    • getGL

      public GL getGL()
    • getGLU

      public GLU getGLU()
    • getGLUT

      public GLUT getGLUT()
    • setGL

      public void setGL(GL gl)
    • forceRepaint

      public void forceRepaint()
      Can be used to update image if camera has changed position. FIXME : Warning if this is invoked by a thread external to AWT, maybe this will require to redraw GL while GL is already used by AWT.