com.threerings.opengl
Class AWTCanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by org.lwjgl.opengl.AWTGLCanvas
              extended by com.threerings.opengl.AWTCanvas
All Implemented Interfaces:
GlCanvas, ComponentListener, HierarchyListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class AWTCanvas
extends AWTGLCanvas
implements GlCanvas

A canvas that extends AWTGLCanvas.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvas
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  Runnable _updater
          The runnable that updates the frame.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AWTCanvas(PixelFormat pformat)
          Creates a canvas with the supplied pixel format.
 
Method Summary
protected  void didInit()
          Override to perform custom initialization.
 Drawable getDrawable()
          Returns the canvas drawable.
protected  void initGL()
           
 void makeCurrent()
          Makes the canvas context current.
protected  void paintGL()
           
 void removeNotify()
           
protected  void renderView()
          Override to render the contents of the canvas.
 void shutdown()
          Shuts down the canvas.
protected  void startUpdating()
          Starts calling updateFrame() regularly.
protected  void stopUpdating()
          Stops calling updateFrame().
 void swapBuffers()
           
protected  void updateFrame()
          Updates and, if the canvas is showing, renders the scene and swaps the buffers.
protected  void updateView()
          Override to perform any updates that are required even if not rendering.
 
Methods inherited from class org.lwjgl.opengl.AWTGLCanvas
addNotify, componentHidden, componentMoved, componentResized, componentShown, createSharedContext, destroy, exceptionOccurred, getContext, hierarchyChanged, isCurrent, paint, releaseContext, setBounds, setCLSharingProperties, setLocation, setLocation, setSize, setSize, setSwapInterval, setVSyncEnabled, update
 
Methods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMinimumSize, setName, setPreferredSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.threerings.opengl.GlCanvas
setVSyncEnabled
 

Field Detail

_updater

protected Runnable _updater
The runnable that updates the frame.

Constructor Detail

AWTCanvas

public AWTCanvas(PixelFormat pformat)
          throws LWJGLException
Creates a canvas with the supplied pixel format.

Throws:
LWJGLException
Method Detail

getDrawable

public Drawable getDrawable()
Description copied from interface: GlCanvas
Returns the canvas drawable.

Specified by:
getDrawable in interface GlCanvas

shutdown

public void shutdown()
Description copied from interface: GlCanvas
Shuts down the canvas.

Specified by:
shutdown in interface GlCanvas

makeCurrent

public void makeCurrent()
Description copied from interface: GlCanvas
Makes the canvas context current.

Specified by:
makeCurrent in interface GlCanvas
Overrides:
makeCurrent in class AWTGLCanvas

swapBuffers

public void swapBuffers()
Overrides:
swapBuffers in class AWTGLCanvas

removeNotify

public void removeNotify()
Overrides:
removeNotify in class AWTGLCanvas

initGL

protected void initGL()
Overrides:
initGL in class AWTGLCanvas

paintGL

protected void paintGL()
Overrides:
paintGL in class AWTGLCanvas

didInit

protected void didInit()
Override to perform custom initialization.


startUpdating

protected void startUpdating()
Starts calling updateFrame() regularly.


stopUpdating

protected void stopUpdating()
Stops calling updateFrame().


updateFrame

protected void updateFrame()
Updates and, if the canvas is showing, renders the scene and swaps the buffers.


updateView

protected void updateView()
Override to perform any updates that are required even if not rendering.


renderView

protected void renderView()
Override to render the contents of the canvas.