public class AWTGLCanvas extends Canvas implements ComponentListener, HierarchyListener
Canvas.AccessibleAWTCanvasComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
AWTGLCanvas()
Constructor using the default PixelFormat.
|
AWTGLCanvas(GraphicsDevice device,
PixelFormat pixel_format)
Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice.
|
AWTGLCanvas(GraphicsDevice device,
PixelFormat pixel_format,
Drawable drawable)
Create an AWTGLCanvas with the requested PixelFormat on the specified GraphicsDevice.
|
AWTGLCanvas(GraphicsDevice device,
PixelFormat pixel_format,
Drawable drawable,
ContextAttribs attribs)
Create an AWTGLCanvas with the requested PixelFormat on the specified GraphicsDevice.
|
AWTGLCanvas(PixelFormat pixel_format)
Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNotify() |
void |
componentHidden(ComponentEvent e) |
void |
componentMoved(ComponentEvent e) |
void |
componentResized(ComponentEvent e) |
void |
componentShown(ComponentEvent e) |
org.lwjgl.opengl.Context |
createSharedContext()
This method should only be called internally.
|
void |
destroy()
Destroy the OpenGL context.
|
protected void |
exceptionOccurred(LWJGLException exception)
This method will be called if an unhandled LWJGLException occurs in paint().
|
org.lwjgl.opengl.Context |
getContext()
This method should only be called internally.
|
void |
hierarchyChanged(HierarchyEvent e) |
protected void |
initGL()
Override this to do initialising of the context.
|
boolean |
isCurrent()
Returns true if the Drawable's context is current in the current thread.
|
void |
makeCurrent()
Make the canvas' context current.
|
void |
paint(Graphics g)
The default paint() operation makes the context current and calls paintGL() which should
be overridden to do GL operations.
|
protected void |
paintGL()
Override this to do painting
|
void |
releaseContext()
If the Drawable's context is current in the current thread, no context will be current after a call to this method.
|
void |
removeNotify() |
void |
setBounds(int x,
int y,
int width,
int height) |
void |
setCLSharingProperties(PointerBuffer properties)
Sets the appropriate khr_gl_sharing properties in the target
PointerBuffer,
so that if it is used in a clCreateContext(FromType) call, the created CL
context will be sharing objects with this Drawable's GL context. |
void |
setLocation(int x,
int y) |
void |
setLocation(Point p) |
void |
setSize(Dimension d) |
void |
setSize(int width,
int height) |
void |
setSwapInterval(int swap_interval)
Set swap interval.
|
void |
setVSyncEnabled(boolean enabled)
Enable vsync
|
void |
swapBuffers()
Swap the canvas' buffer
|
void |
update(Graphics g)
override update to avoid clearing
|
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategyaction, 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, revalidate, 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, validatepublic AWTGLCanvas()
throws LWJGLException
LWJGLExceptionpublic AWTGLCanvas(PixelFormat pixel_format) throws LWJGLException
pixel_format - The desired pixel format. May not be nullLWJGLExceptionpublic AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException
device - the device to create the canvas on.pixel_format - The desired pixel format. May not be nullLWJGLExceptionpublic AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format, Drawable drawable) throws LWJGLException
device - the device to create the canvas on.pixel_format - The desired pixel format. May not be nulldrawable - The Drawable to share context withLWJGLExceptionpublic AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format, Drawable drawable, ContextAttribs attribs) throws LWJGLException
device - the device to create the canvas on.pixel_format - The desired pixel format. May not be nulldrawable - The Drawable to share context withattribs - The ContextAttribs to use when creating the context. (optional, may be null)LWJGLExceptionpublic org.lwjgl.opengl.Context getContext()
public org.lwjgl.opengl.Context createSharedContext()
throws LWJGLException
LWJGLExceptionpublic void removeNotify()
removeNotify in class Componentpublic void setSwapInterval(int swap_interval)
public void setVSyncEnabled(boolean enabled)
public void swapBuffers()
throws LWJGLException
LWJGLExceptionpublic boolean isCurrent()
throws LWJGLException
DrawableLWJGLExceptionpublic void makeCurrent()
throws LWJGLException
LWJGLExceptionpublic void releaseContext()
throws LWJGLException
DrawableLWJGLExceptionpublic final void destroy()
public final void setCLSharingProperties(PointerBuffer properties) throws LWJGLException
DrawablePointerBuffer,
so that if it is used in a clCreateContext(FromType) call, the created CL
context will be sharing objects with this Drawable's GL context. After a
call to this method, the target buffer position will have advanced by 2 to 4 positions,
depending on the implementation.properties - The target properties buffer. It must have at least 4 positions remaining.LWJGLExceptionprotected void initGL()
protected void paintGL()
public final void paint(Graphics g)
protected void exceptionOccurred(LWJGLException exception)
exception - The exception that occurred.public void update(Graphics g)
public void componentShown(ComponentEvent e)
componentShown in interface ComponentListenerpublic void componentHidden(ComponentEvent e)
componentHidden in interface ComponentListenerpublic void componentResized(ComponentEvent e)
componentResized in interface ComponentListenerpublic void componentMoved(ComponentEvent e)
componentMoved in interface ComponentListenerpublic void setLocation(int x,
int y)
setLocation in class Componentpublic void setLocation(Point p)
setLocation in class Componentpublic void setBounds(int x,
int y,
int width,
int height)
public void hierarchyChanged(HierarchyEvent e)
hierarchyChanged in interface HierarchyListenerCopyright © 2002-2009 lwjgl.org. All Rights Reserved.