|
JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java (public API).
|
A fairly direct port of Brian Paul's tile rendering library, found at http://www.mesa3d.org/brianp/TR.html . More...
Public Member Functions | |||||||
| TileRenderer () | |||||||
| Creates a new TileRenderer object. More... | |||||||
| final void | setImageSize (final int width, final int height) | ||||||
Sets the desired size of the final image.
| |||||||
| final void | clipImageSize (final int width, final int height) | ||||||
Clips the image-size this tile-renderer iterates through, which can be retrieved via getClippedImageSize(). More... | |||||||
| final DimensionImmutable | getClippedImageSize () | ||||||
| Returns the clipped image-size. More... | |||||||
| final void | setTileSize (final int width, final int height, final int border) | ||||||
| Sets the size of the tiles to use in rendering. More... | |||||||
| void | setTileOffset (final int xoff, final int yoff) | ||||||
Sets an xy offset for the resulting tiles x-pos and y-pos. More... | |||||||
| final void | reset () | ||||||
Method resets implementation's internal state to start of tiling as required for beginTile(GL) if end of tiling has been reached.Implementation is a nop where end of tiling is never reached. More... | |||||||
| final int | getParam (final int pname) | ||||||
| Gets the parameters of this TileRenderer object. More... | |||||||
| final void | setRowOrder (final int order) | ||||||
Sets the order of row traversal, default is TR_BOTTOM_TO_TOP. More... | |||||||
| final boolean | isSetup () | ||||||
| Returns true if this instance is setup properly, i.e. More... | |||||||
| final boolean | eot () | ||||||
Returns true if end of tiling has been reached, otherwise false.end of tiling criteria is implementation specific and may never be reached. User needs to reset() tiling after reaching end of tiling before calling beginTile(GL) again. More... | |||||||
| final void | beginTile (final GL gl) throws IllegalStateException, GLException | ||||||
Begins rendering a tile.This method modifies the viewport, see below. User shall reset the viewport when finishing all tile rendering, i.e. after very last call of endTile(GL)! The PMV Matrix must be reshaped after this call using:
endTile(GL). User has to comply with the GL profile requirement. If end of tiling has been reached, user needs to reset() tiling before calling this method.
| |||||||
| void | endTile (final GL gl) throws IllegalStateException, GLException | ||||||
Must be called after rendering the scene, see beginTile(GL). More... | |||||||
Public Member Functions inherited from com.jogamp.opengl.util.TileRendererBase | |||||||
| StringBuilder | toString (final StringBuilder sb) | ||||||
| String | toString () | ||||||
| abstract int | getParam (int pname) throws IllegalArgumentException | ||||||
| Gets the parameters of this TileRenderer object. More... | |||||||
| final void | setTileBuffer (final GLPixelBuffer buffer) | ||||||
| Specify a buffer the tiles to be copied to. More... | |||||||
| final GLPixelBuffer | getTileBuffer () | ||||||
| void | setImageSize (final int width, final int height) | ||||||
| Sets the desired size of the final image. More... | |||||||
| final DimensionImmutable | getImageSize () | ||||||
| final void | setImageBuffer (final GLPixelBuffer buffer) | ||||||
| Sets the buffer in which to store the final image. More... | |||||||
| final GLPixelBuffer | getImageBuffer () | ||||||
| abstract boolean | isSetup () | ||||||
| Returns true if this instance is setup properly, i.e. More... | |||||||
| abstract boolean | eot () | ||||||
| Returns true if end of tiling has been reached, otherwise false. More... | |||||||
| abstract void | reset () | ||||||
Method resets implementation's internal state to start of tiling as required for beginTile(GL) if end of tiling has been reached. More... | |||||||
| abstract void | beginTile (GL gl) throws IllegalStateException, GLException | ||||||
| Begins rendering a tile. More... | |||||||
| abstract void | endTile (GL gl) throws IllegalStateException, GLException | ||||||
Must be called after rendering the scene, see beginTile(GL). More... | |||||||
| final boolean | reqPreSwapBuffers (final GLCapabilitiesImmutable chosenCaps) | ||||||
Determines whether the chosen GLCapabilitiesImmutable requires a pre-swap-buffers before accessing the results, i.e. More... | |||||||
| final void | attachAutoDrawable (final GLAutoDrawable glad) throws IllegalStateException | ||||||
Attaches the given GLAutoDrawable to this tile renderer. More... | |||||||
| final GLAutoDrawable | getAttachedDrawable () | ||||||
Returns a previously attached GLAutoDrawable, null if none is attached. More... | |||||||
| final void | detachAutoDrawable () | ||||||
Detaches the given GLAutoDrawable from this tile renderer. More... | |||||||
| final void | setGLEventListener (final GLEventListener preTile, final GLEventListener postTile) | ||||||
Set GLEventListener for pre- and post operations when used w/ attachAutoDrawable(GLAutoDrawable) for each GLEventListener callback. More... | |||||||
| final void | display () throws IllegalStateException | ||||||
Rendering one tile, by simply calling GLAutoDrawable#display(). More... | |||||||
Static Public Attributes | |
| static final int | TR_IMAGE_CLIPPING_WIDTH = 7 |
| The width of the final clipped image. More... | |
| static final int | TR_IMAGE_CLIPPING_HEIGHT = 8 |
| The height of the final clipped image. More... | |
| static final int | TR_TILE_WIDTH = 9 |
| The width of the tiles. More... | |
| static final int | TR_TILE_HEIGHT = 10 |
| The height of the tiles. More... | |
| static final int | TR_TILE_BORDER = 11 |
| The width of the border around the tiles. More... | |
| static final int | TR_TILE_X_OFFSET = 12 |
| The tiles x-offset. More... | |
| static final int | TR_TILE_Y_OFFSET = 13 |
| The tiles y-offset. More... | |
| static final int | TR_ROWS = 14 |
| The number of rows of tiles. More... | |
| static final int | TR_COLUMNS = 15 |
| The number of columns of tiles. More... | |
| static final int | TR_CURRENT_TILE_NUM = 16 |
| The current tile number. More... | |
| static final int | TR_CURRENT_ROW = 17 |
| The current row number. More... | |
| static final int | TR_CURRENT_COLUMN = 18 |
| The current column number. More... | |
| static final int | TR_ROW_ORDER = 19 |
| The order that the rows are traversed. More... | |
| static final int | TR_TOP_TO_BOTTOM = 20 |
| Indicates we are traversing rows from the top to the bottom. More... | |
| static final int | TR_BOTTOM_TO_TOP = 21 |
| Indicates we are traversing rows from the bottom to the top (default). More... | |
Static Public Attributes inherited from com.jogamp.opengl.util.TileRendererBase | |
| static final int | TR_IMAGE_WIDTH = 1 |
| The width of the final image. More... | |
| static final int | TR_IMAGE_HEIGHT = 2 |
| The height of the final image. More... | |
| static final int | TR_CURRENT_TILE_X_POS = 3 |
| The x-pos of the current tile. More... | |
| static final int | TR_CURRENT_TILE_Y_POS = 4 |
| The y-pos of the current tile. More... | |
| static final int | TR_CURRENT_TILE_WIDTH = 5 |
| The width of the current tile. More... | |
| static final int | TR_CURRENT_TILE_HEIGHT = 6 |
| The height of the current tile. More... | |
Protected Member Functions | |
| StringBuilder | tileDetails (final StringBuilder sb) |
Protected Member Functions inherited from com.jogamp.opengl.util.TileRendererBase | |
| StringBuilder | tileDetails (final StringBuilder sb) |
| TileRendererBase () | |
Additional Inherited Members | |
Protected Attributes inherited from com.jogamp.opengl.util.TileRendererBase | |
| final Dimension | imageSize = new Dimension(0, 0) |
| final GLPixelStorageModes | psm = new GLPixelStorageModes() |
| GLPixelBuffer | imageBuffer |
| GLPixelBuffer | tileBuffer |
| boolean | beginCalled = false |
| int | currentTileXPos |
| int | currentTileYPos |
| int | currentTileWidth |
| int | currentTileHeight |
| GLAutoDrawable | glad |
| boolean | gladRequiresPreSwap |
| boolean | gladAutoSwapBufferMode = true |
| GLEventListener[] | listeners |
| boolean[] | listenersInit |
| GLEventListener | glEventListenerPre = null |
| GLEventListener | glEventListenerPost = null |
A fairly direct port of Brian Paul's tile rendering library, found at http://www.mesa3d.org/brianp/TR.html .
I've java-fied it, but the functionality is the same.
Original code Copyright (C) 1997-2005 Brian Paul. Licensed under BSD-compatible terms with permission of the author. See LICENSE.txt for license information.
Enhanced for GL2ES3.
See TileRendererBase for details.
Definition at line 66 of file TileRenderer.java.
| com.jogamp.opengl.util.TileRenderer.TileRenderer | ( | ) |
Creates a new TileRenderer object.
Definition at line 157 of file TileRenderer.java.
| final void com.jogamp.opengl.util.TileRenderer.beginTile | ( | final GL | gl | ) | throws IllegalStateException, GLException |
Begins rendering a tile.This method modifies the viewport, see below. User shall reset the viewport when finishing all tile rendering, i.e. after very last call of endTile(GL)! The PMV Matrix must be reshaped after this call using:
current tile's x-pos current tile's y-pos final image width final image height endTile(GL). User has to comply with the GL profile requirement. If end of tiling has been reached, user needs to reset() tiling before calling this method. | gl | The gl context |
| IllegalStateException | if image-size is undefined, an implementation related setup has not be performed or {@ link eot()} has been reached. See implementing classes. |
| GLException | if image buffer is used but gl instance is < GL2ES3 |
| IllegalStateException | if image-size has not been set or end-of-tiling has been reached. |
Reimplemented from com.jogamp.opengl.util.TileRendererBase.
Definition at line 391 of file TileRenderer.java.
| final void com.jogamp.opengl.util.TileRenderer.clipImageSize | ( | final int | width, |
| final int | height | ||
| ) |
Clips the image-size this tile-renderer iterates through, which can be retrieved via getClippedImageSize().
Original image-size stored in this tile-renderer is unmodified.
Implementation reset() internal states.
| width | The image-clipping.width |
| height | The image-clipping.height |
Definition at line 187 of file TileRenderer.java.
| void com.jogamp.opengl.util.TileRenderer.endTile | ( | final GL | gl | ) | throws IllegalStateException, GLException |
Must be called after rendering the scene, see beginTile(GL).
Please consider reqPreSwapBuffers(GLCapabilitiesImmutable) to determine whether you need to perform swap-buffers before or after calling this method!
User has to comply with the GL profile requirement.
| gl | the gl context |
| IllegalStateException | if beginTile(gl) has not been called |
| GLException | if image buffer is used but gl instance is < GL2ES3 |
Reimplemented from com.jogamp.opengl.util.TileRendererBase.
Definition at line 449 of file TileRenderer.java.
| final boolean com.jogamp.opengl.util.TileRenderer.eot | ( | ) |
Returns true if end of tiling has been reached, otherwise false.end of tiling criteria is implementation specific and may never be reached. User needs to reset() tiling after reaching end of tiling before calling beginTile(GL) again.
end of tiling is reached w/ TileRenderer, if at least one of the following is true:
TR_CURRENT_TILE_NUM is -1 TR_COLUMNS or TR_ROWS is 0 Reimplemented from com.jogamp.opengl.util.TileRendererBase.
Definition at line 377 of file TileRenderer.java.
| final DimensionImmutable com.jogamp.opengl.util.TileRenderer.getClippedImageSize | ( | ) |
Returns the clipped image-size.
If a image-size is clipped via clipImageSize(int, int), method returns:
min( image-clipping, image-size ), otherwise image-size The clipping width and height can be retrieved via TR_IMAGE_CLIPPING_WIDTH TR_IMAGE_CLIPPING_HEIGHT.
Definition at line 211 of file TileRenderer.java.
| final int com.jogamp.opengl.util.TileRenderer.getParam | ( | final int | pname | ) |
Gets the parameters of this TileRenderer object.
| pname | The parameter name that is to be retrieved |
| IllegalArgumentException | if pname is not handled |
Reimplemented from com.jogamp.opengl.util.TileRendererBase.
Definition at line 302 of file TileRenderer.java.
| final boolean com.jogamp.opengl.util.TileRenderer.isSetup | ( | ) |
Returns true if this instance is setup properly, i.e.
setImageSize(int, int) .., and ready for beginTile(GL). Otherwise returns false.
Reimplemented from com.jogamp.opengl.util.TileRendererBase.
Definition at line 361 of file TileRenderer.java.
| final void com.jogamp.opengl.util.TileRenderer.reset | ( | ) |
Method resets implementation's internal state to start of tiling as required for beginTile(GL) if end of tiling has been reached.Implementation is a nop where end of tiling is never reached.
Reset internal states of TileRenderer are:
TR_ROWS TR_COLUMNS TR_CURRENT_COLUMN TR_CURRENT_ROW TR_CURRENT_TILE_NUM TR_CURRENT_TILE_X_POS TR_CURRENT_TILE_Y_POS TR_CURRENT_TILE_WIDTH TR_CURRENT_TILE_HEIGHT Reimplemented from com.jogamp.opengl.util.TileRendererBase.
Definition at line 280 of file TileRenderer.java.
| final void com.jogamp.opengl.util.TileRenderer.setImageSize | ( | final int | width, |
| final int | height | ||
| ) |
Sets the desired size of the final image.
| width | The width of the final image |
| height | The height of the final image |
Implementation reset() internal states.
Reimplemented from com.jogamp.opengl.util.TileRendererBase.
Definition at line 168 of file TileRenderer.java.
| final void com.jogamp.opengl.util.TileRenderer.setRowOrder | ( | final int | order | ) |
Sets the order of row traversal, default is TR_BOTTOM_TO_TOP.
| order | The row traversal order, must be either TR_TOP_TO_BOTTOM or TR_BOTTOM_TO_TOP. |
Definition at line 352 of file TileRenderer.java.
| void com.jogamp.opengl.util.TileRenderer.setTileOffset | ( | final int | xoff, |
| final int | yoff | ||
| ) |
Sets an xy offset for the resulting tiles x-pos and y-pos.
Definition at line 258 of file TileRenderer.java.
| final void com.jogamp.opengl.util.TileRenderer.setTileSize | ( | final int | width, |
| final int | height, | ||
| final int | border | ||
| ) |
Sets the size of the tiles to use in rendering.
The actual effective size of the tile depends on the border size, ie ( width - 2*border ) * ( height - 2 * border )
Implementation reset() internal states.
| width | The width of the tiles. Must not be larger than the GL context |
| height | The height of the tiles. Must not be larger than the GL context |
| border | The width of the borders on each tile. This is needed to avoid artifacts when rendering lines or points with thickness > 1. |
Definition at line 239 of file TileRenderer.java.
|
protected |
Reimplemented from com.jogamp.opengl.util.TileRendererBase.
Definition at line 148 of file TileRenderer.java.
|
static |
Indicates we are traversing rows from the bottom to the top (default).
See getParam(int).
Definition at line 126 of file TileRenderer.java.
|
static |
The number of columns of tiles.
See getParam(int).
Definition at line 102 of file TileRenderer.java.
|
static |
|
static |
|
static |
The current tile number.
Has value -1 if eot(). See getParam(int).
Definition at line 106 of file TileRenderer.java.
|
static |
The height of the final clipped image.
See getParam(int).
Definition at line 74 of file TileRenderer.java.
|
static |
The width of the final clipped image.
See getParam(int).
Definition at line 70 of file TileRenderer.java.
|
static |
The order that the rows are traversed.
See getParam(int).
Definition at line 118 of file TileRenderer.java.
|
static |
|
static |
The width of the border around the tiles.
See getParam(int).
Definition at line 86 of file TileRenderer.java.
|
static |
|
static |
|
static |
|
static |
|
static |
Indicates we are traversing rows from the top to the bottom.
See getParam(int).
Definition at line 122 of file TileRenderer.java.