An AWT rendering context.
| Modifier and Type | Field and Description |
|---|---|
| private final ContextAttribs | attribs
The ContextAttribs to use when creating the context |
| private ContextGL | |
| private final Drawable | drawable
The drawable to share context with |
| private boolean | first_run
Tracks whether initGL() needs to be called |
| private static final AWTCanvasImplementation | |
| private PeerInfo | peer_info
Context handle |
| private final PixelFormat | pixel_format
The requested pixel format |
| private int | reentry_count
re-entry counter for support for re-entrant redrawing in paint(). |
| private static final long | |
| private Object | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | |
| public | AWTGLCanvas(PixelFormat
The desired pixel format. May not be null pixel_format)Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice. |
| public | AWTGLCanvas(GraphicsDevice
the device to create the canvas on. device, PixelFormat The desired pixel format. May not be null pixel_format)Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice. |
| public | AWTGLCanvas(GraphicsDevice
the device to create the canvas on. device, PixelFormat The desired pixel format. May not be null pixel_format, Drawable The Drawable to share context with drawable)Create an AWTGLCanvas with the requested PixelFormat on the specified GraphicsDevice. |
| public | AWTGLCanvas(GraphicsDevice
the device to create the canvas on. device, PixelFormat The desired pixel format. May not be null pixel_format, Drawable The Drawable to share context with drawable, ContextAttribs The ContextAttribs to use when creating the context. (optional, may be null) attribs)Create an AWTGLCanvas with the requested PixelFormat on the specified GraphicsDevice. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | componentHidden(ComponentEvent
the event to be processed e)Implements java. |
| public void | componentMoved(ComponentEvent
the event to be processed e)Implements java. |
| public void | componentResized(ComponentEvent
the event to be processed e)Implements java. |
| public void | componentShown(ComponentEvent
the event to be processed e)Implements java. |
| pack-priv static AWTCanvasImplementation | |
| public ContextGL | createSharedContext()
Implements org. |
| public final void | |
| protected void | exceptionOccurred(LWJGLException
The exception that occurred. exception)This method will be called if an unhandled LWJGLException occurs in paint(). |
| public ContextGL | getContext()
Implements org. |
| public PixelFormatLWJGL | |
| public void | hierarchyChanged(HierarchyEvent
the event to be processed e)Implements java. |
| public void | initContext(final float r, final float g, final float b)
Implements org. |
| protected void | |
| public boolean | isCurrent()
Implements org. |
| public void | |
| public final void | paint(Graphics
the specified Graphics context g)Overrides java. |
| protected void | |
| public void | releaseContext()
Implements org. |
| public void | removeNotify()
Overrides java. Component undisplayable by destroying it native
screen resource.
|
| public void | setBounds(int
the new x-coordinate of this component x, int the new y-coordinate of this component y, int the new width, int width of this componentthe new height)height of this
componentOverrides java. |
| public final void | setCLSharingProperties(final PointerBuffer
The target properties buffer. It must have at least 4 positions remaining. properties)Implements org. 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.
|
| public void | setLocation(int
the x-coordinate of the new location's
top-left corner in the parent's coordinate space x, int the y-coordinate of the new location's
top-left corner in the parent's coordinate space y)Overrides java. |
| public void | setLocation(Point
the point defining the top-left corner
of the new location, given in the coordinate space of this
component's parent p)Overrides java. |
| public void | |
| public void | setPixelFormat(final PixelFormatLWJGL pf, final ContextAttribs attribs)
Implements org. |
| public void | setSize(Dimension
the dimension specifying the new size
of this component d)Overrides java. d.width
and height d.height.
|
| public void | setSize(int
the new width of this component in pixels width, int the new height of this component in pixels height)Overrides java. width
and height height.
|
| public void | setSwapInterval(int swap_interval)
Implements org. |
| private void | |
| public void | |
| public void | |
| public void | update(Graphics
the specified Graphics context g)Overrides java. |
| attribs | back to summary |
|---|---|
| private final ContextAttribs attribs The ContextAttribs to use when creating the context | |
| context | back to summary |
|---|---|
| private ContextGL context | |
| drawable | back to summary |
|---|---|
| private final Drawable drawable The drawable to share context with | |
| first_run | back to summary |
|---|---|
| private boolean first_run Tracks whether initGL() needs to be called | |
| implementation | back to summary |
|---|---|
| private static final AWTCanvasImplementation implementation | |
| peer_info | back to summary |
|---|---|
| private PeerInfo peer_info Context handle | |
| pixel_format | back to summary |
|---|---|
| private final PixelFormat pixel_format The requested pixel format | |
| reentry_count | back to summary |
|---|---|
| private int reentry_count re-entry counter for support for re-entrant redrawing in paint(). It happens when using dialog boxes. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| SYNC_LOCK | back to summary |
|---|---|
| private Object SYNC_LOCK | |
| update_context | back to summary |
|---|---|
| private boolean update_context | |
| AWTGLCanvas | back to summary |
|---|---|
| public AWTGLCanvas() throws LWJGLException Constructor using the default PixelFormat. | |
| AWTGLCanvas | back to summary |
|---|---|
| public AWTGLCanvas(PixelFormat pixel_format) throws LWJGLException Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice.
| |
| AWTGLCanvas | back to summary |
|---|---|
| public AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException Create an AWTGLCanvas with the requested PixelFormat on the default GraphicsDevice.
| |
| AWTGLCanvas | back to summary |
|---|---|
| public AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format, Drawable drawable) throws LWJGLException Create an AWTGLCanvas with the requested PixelFormat on the specified GraphicsDevice.
| |
| AWTGLCanvas | back to summary |
|---|---|
| public AWTGLCanvas(GraphicsDevice device, PixelFormat pixel_format, Drawable drawable, ContextAttribs attribs) throws LWJGLException Create an AWTGLCanvas with the requested PixelFormat on the specified GraphicsDevice.
| |
| addNotify | back to summary |
|---|---|
| public void addNotify() Overrides java. Doc from java. Creates the peer of the canvas. This peer allows you to change the user interface of the canvas without changing its functionality. | |
| checkGLError | back to summary |
|---|---|
| public void checkGLError() Implements org. | |
| componentHidden | back to summary |
|---|---|
| public void componentHidden(ComponentEvent e) Implements java. Doc from java. Invoked when the component has been made invisible.
| |
| componentMoved | back to summary |
|---|---|
| public void componentMoved(ComponentEvent e) Implements java. Doc from java. Invoked when the component's position changes.
| |
| componentResized | back to summary |
|---|---|
| public void componentResized(ComponentEvent e) Implements java. Doc from java. Invoked when the component's size changes.
| |
| componentShown | back to summary |
|---|---|
| public void componentShown(ComponentEvent e) Implements java. Doc from java. Invoked when the component has been made visible.
| |
| createImplementation | back to summary |
|---|---|
| pack-priv static AWTCanvasImplementation createImplementation() | |
| createSharedContext | back to summary |
|---|---|
| public ContextGL createSharedContext() throws LWJGLException Implements org. This method should only be called internally.
| |
| destroy | back to summary |
|---|---|
| public final void destroy() Implements org. Destroy the OpenGL context. This happens when the component becomes undisplayable | |
| exceptionOccurred | back to summary |
|---|---|
| protected void exceptionOccurred(LWJGLException exception) This method will be called if an unhandled LWJGLException occurs in paint(). Override this method to be notified of this.
| |
| getContext | back to summary |
|---|---|
| public ContextGL getContext() Implements org. This method should only be called internally.
| |
| getPixelFormat | back to summary |
|---|---|
| public PixelFormatLWJGL getPixelFormat() Implements org. | |
| hierarchyChanged | back to summary |
|---|---|
| public void hierarchyChanged(HierarchyEvent e) Implements java. Doc from java. Called when the hierarchy has been changed. To discern the actual
type of change, call
| |
| initContext | back to summary |
|---|---|
| public void initContext(final float r, final float g, final float b) Implements org. | |
| initGL | back to summary |
|---|---|
| protected void initGL() Override this to do initialising of the context. It will be called once from paint(), immediately after the context is created and made current. | |
| isCurrent | back to summary |
|---|---|
| public boolean isCurrent() throws LWJGLException Implements org. Doc from org. Returns true if the Drawable's context is current in the current thread. | |
| makeCurrent | back to summary |
|---|---|
| public void makeCurrent() throws LWJGLException Implements org. Make the canvas' context current. It is highly recommended that the context is only made current inside the AWT thread (for example in an overridden paintGL()). | |
| paint | back to summary |
|---|---|
| public final void paint(Graphics g) Overrides java. The default paint() operation makes the context current and calls paintGL() which should be overridden to do GL operations.
| |
| paintGL | back to summary |
|---|---|
| protected void paintGL() Override this to do painting | |
| releaseContext | back to summary |
|---|---|
| public void releaseContext() throws LWJGLException Implements org. Doc from org. If the Drawable's context is current in the current thread, no context will be current after a call to this method. | |
| removeNotify | back to summary |
|---|---|
| public void removeNotify() Overrides java. Doc from java. Makes this
This method is called by the toolkit internally and should
not be called directly by programs. Code overriding
this method should call | |
| setBounds | back to summary |
|---|---|
| public void setBounds(int x, int y, int width, int height) Overrides java. Doc from java. Moves and resizes this component. The new location of the top-left
corner is specified by This method changes layout-related information, and therefore, invalidates the component hierarchy.
| |
| setCLSharingProperties | back to summary |
|---|---|
| public final void setCLSharingProperties(final PointerBuffer properties) throws LWJGLException Implements org. Doc from org. Sets the appropriate khr_gl_sharing properties in the target
| |
| setLocation | back to summary |
|---|---|
| public void setLocation(int x, int y) Overrides java. Doc from java. Moves this component to a new location. The top-left corner of
the new location is specified by the This method changes layout-related information, and therefore, invalidates the component hierarchy.
| |
| setLocation | back to summary |
|---|---|
| public void setLocation(Point p) Overrides java. Doc from java. Moves this component to a new location. The top-left corner of
the new location is specified by point This method changes layout-related information, and therefore, invalidates the component hierarchy.
| |
| setPixelFormat | back to summary |
|---|---|
| public void setPixelFormat(final PixelFormatLWJGL pf) throws LWJGLException Implements org. | |
| setPixelFormat | back to summary |
|---|---|
| public void setPixelFormat(final PixelFormatLWJGL pf, final ContextAttribs attribs) throws LWJGLException Implements org. | |
| setSize | back to summary |
|---|---|
| public void setSize(Dimension d) Overrides java. Doc from java. Resizes this component so that it has width This method changes layout-related information, and therefore, invalidates the component hierarchy.
| |
| setSize | back to summary |
|---|---|
| public void setSize(int width, int height) Overrides java. Doc from java. Resizes this component so that it has width This method changes layout-related information, and therefore, invalidates the component hierarchy.
| |
| setSwapInterval | back to summary |
|---|---|
| public void setSwapInterval(int swap_interval) Implements org. Set swap interval. | |
| setUpdate | back to summary |
|---|---|
| private void setUpdate() | |
| setVSyncEnabled | back to summary |
|---|---|
| public void setVSyncEnabled(boolean enabled) Enable vsync | |
| swapBuffers | back to summary |
|---|---|
| public void swapBuffers() throws LWJGLException Implements org. Swap the canvas' buffer | |
| update | back to summary |
|---|---|
| public void update(Graphics g) Overrides java. override update to avoid clearing
| |