|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
Provides a Java 2D overlay on top of an arbitrary GLDrawable, making it easier to do things like draw text and images on top of an OpenGL scene while still maintaining reasonably good efficiency. More...
Public Member Functions | |
| Overlay (final GLDrawable drawable) | |
| Creates a new Java 2D overlay on top of the specified GLDrawable. More... | |
| Graphics2D | createGraphics () |
Creates a Graphics2D instance for rendering into the overlay. More... | |
| boolean | contentsLost () |
Indicates whether the Java 2D contents of the overlay were lost since the last time createGraphics was called. More... | |
| void | markDirty (final int x, final int y, final int width, final int height) |
| Marks the given region of the overlay as dirty. More... | |
| void | drawAll () throws GLException |
| Draws the entire contents of the overlay on top of the OpenGL drawable. More... | |
| void | beginRendering () throws GLException |
| Begins the OpenGL rendering process for the overlay. More... | |
| void | endRendering () throws GLException |
| Ends the OpenGL rendering process for the overlay. More... | |
| void | draw (final int x, final int y, final int width, final int height) throws GLException |
| Draws the specified sub-rectangle of the overlay on top of the OpenGL drawable. More... | |
| void | draw (final int screenx, final int screeny, final int overlayx, final int overlayy, final int width, final int height) throws GLException |
| Draws the specified sub-rectangle of the overlay at the specified x and y coordinate on top of the OpenGL drawable. More... | |
Provides a Java 2D overlay on top of an arbitrary GLDrawable, making it easier to do things like draw text and images on top of an OpenGL scene while still maintaining reasonably good efficiency.
Definition at line 51 of file Overlay.java.
| com.jogamp.opengl.util.awt.Overlay.Overlay | ( | final GLDrawable | drawable | ) |
Creates a new Java 2D overlay on top of the specified GLDrawable.
Definition at line 58 of file Overlay.java.
| void com.jogamp.opengl.util.awt.Overlay.beginRendering | ( | ) | throws GLException |
Begins the OpenGL rendering process for the overlay.
This is separated out so advanced applications can render independent pieces of the overlay to different portions of the drawable.
| GLException | If an OpenGL context is not current when this method is called |
Definition at line 132 of file Overlay.java.
| boolean com.jogamp.opengl.util.awt.Overlay.contentsLost | ( | ) |
Indicates whether the Java 2D contents of the overlay were lost since the last time createGraphics was called.
This method should be called immediately after calling createGraphics to see whether the entire contents of the overlay need to be redrawn or just the region the application is interested in updating.
Definition at line 87 of file Overlay.java.
| Graphics2D com.jogamp.opengl.util.awt.Overlay.createGraphics | ( | ) |
Creates a Graphics2D instance for rendering into the overlay.
The returned object should be disposed of using the normal Graphics.dispose() method once it is no longer being used.
Graphics2D object for rendering into the backing store of this renderer Definition at line 70 of file Overlay.java.
| void com.jogamp.opengl.util.awt.Overlay.draw | ( | final int | screenx, |
| final int | screeny, | ||
| final int | overlayx, | ||
| final int | overlayy, | ||
| final int | width, | ||
| final int | height | ||
| ) | throws GLException |
Draws the specified sub-rectangle of the overlay at the specified x and y coordinate on top of the OpenGL drawable.
beginRendering and endRendering must be used in conjunction with this method to achieve proper rendering results. This method should be called while the OpenGL context for the drawable is current, and after your OpenGL scene has been rendered.
| screenx | the on-screen x coordinate at which to draw the rectangle |
| screeny | the on-screen y coordinate (relative to lower left) at which to draw the rectangle |
| overlayx | the x coordinate of the pixel in the overlay of the lower left portion of the rectangle to draw |
| overlayy | the y coordinate of the pixel in the overlay (relative to lower left) of the lower left portion of the rectangle to draw |
| width | the width of the rectangle to draw |
| height | the height of the rectangle to draw |
| GLException | If an OpenGL context is not current when this method is called |
Definition at line 187 of file Overlay.java.
| void com.jogamp.opengl.util.awt.Overlay.draw | ( | final int | x, |
| final int | y, | ||
| final int | width, | ||
| final int | height | ||
| ) | throws GLException |
Draws the specified sub-rectangle of the overlay on top of the OpenGL drawable.
beginRendering and endRendering must be used in conjunction with this method to achieve proper rendering results. This method should be called while the OpenGL context for the drawable is current, and after your OpenGL scene has been rendered.
| x | the lower-left x coordinate (relative to the lower left of the overlay) of the rectangle to draw |
| y | the lower-left y coordinate (relative to the lower left of the overlay) of the rectangle to draw |
| width | the width of the rectangle to draw |
| height | the height of the rectangle to draw |
| GLException | If an OpenGL context is not current when this method is called |
Definition at line 162 of file Overlay.java.
| void com.jogamp.opengl.util.awt.Overlay.drawAll | ( | ) | throws GLException |
Draws the entire contents of the overlay on top of the OpenGL drawable.
This is a convenience method which encapsulates all portions of the rendering process; if this method is used, beginRendering, endRendering, etc. should not be used. This method should be called while the OpenGL context for the drawable is current, and after your OpenGL scene has been rendered.
| GLException | If an OpenGL context is not current when this method is called |
Definition at line 120 of file Overlay.java.
| void com.jogamp.opengl.util.awt.Overlay.endRendering | ( | ) | throws GLException |
Ends the OpenGL rendering process for the overlay.
This is separated out so advanced applications can render independent pieces of the overlay to different portions of the drawable.
| GLException | If an OpenGL context is not current when this method is called |
Definition at line 142 of file Overlay.java.
| void com.jogamp.opengl.util.awt.Overlay.markDirty | ( | final int | x, |
| final int | y, | ||
| final int | width, | ||
| final int | height | ||
| ) |
Marks the given region of the overlay as dirty.
This region, and any previously set dirty regions, will be automatically synchronized with the underlying Texture during the next draw or drawAll operation, at which point the dirty region will be cleared. It is not necessary for an OpenGL context to be current when this method is called.
| x | the x coordinate (in Java 2D coordinates – relative to upper left) of the region to update |
| y | the y coordinate (in Java 2D coordinates – relative to upper left) of the region to update |
| width | the width of the region to update |
| height | the height of the region to update |
| GLException | If an OpenGL context is not current when this method is called |
Definition at line 106 of file Overlay.java.