JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.opengl.util.TileRenderer Class Reference

A fairly direct port of Brian Paul's tile rendering library, found at http://www.mesa3d.org/brianp/TR.html . More...

Inheritance diagram for com.jogamp.opengl.util.TileRenderer:
Collaboration diagram for com.jogamp.opengl.util.TileRenderer:

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.
Parameters
widthThe width of the final image
heightThe height of the final image
More...
 
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:

Use shall render the scene afterwards, concluded with a call to this renderer 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.
Parameters
glThe gl context
Exceptions
IllegalStateExceptionif image-size is undefined, an implementation related setup has not be performed or {@ link eot()} has been reached. See implementing classes.
GLExceptionif image buffer is used but gl instance is < GL2ES3
See also
isSetup()
eot()
reset()
More...
 
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
 

Detailed Description

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.

Author
ryanm, sgothel

Definition at line 66 of file TileRenderer.java.

Constructor & Destructor Documentation

◆ TileRenderer()

com.jogamp.opengl.util.TileRenderer.TileRenderer ( )

Creates a new TileRenderer object.

Definition at line 157 of file TileRenderer.java.

Here is the caller graph for this function:

Member Function Documentation

◆ beginTile()

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:

Use shall render the scene afterwards, concluded with a call to this renderer 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.
Parameters
glThe gl context
Exceptions
IllegalStateExceptionif image-size is undefined, an implementation related setup has not be performed or {@ link eot()} has been reached. See implementing classes.
GLExceptionif image buffer is used but gl instance is < GL2ES3
See also
isSetup()
eot()
reset()

Exceptions
IllegalStateExceptionif 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clipImageSize()

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.

Parameters
widthThe image-clipping.width
heightThe image-clipping.height
See also
getClippedImageSize()

Definition at line 187 of file TileRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endTile()

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.

Parameters
glthe gl context
Exceptions
IllegalStateExceptionif beginTile(gl) has not been called
GLExceptionif image buffer is used but gl instance is < GL2ES3

Reimplemented from com.jogamp.opengl.util.TileRendererBase.

Definition at line 449 of file TileRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ eot()

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:

Reimplemented from com.jogamp.opengl.util.TileRendererBase.

Definition at line 377 of file TileRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getClippedImageSize()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getParam()

final int com.jogamp.opengl.util.TileRenderer.getParam ( final int  pname)

Gets the parameters of this TileRenderer object.

Parameters
pnameThe parameter name that is to be retrieved
Returns
the value of the parameter
Exceptions
IllegalArgumentExceptionif pname is not handled

Reimplemented from com.jogamp.opengl.util.TileRendererBase.

Definition at line 302 of file TileRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSetup()

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

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:

Reimplemented from com.jogamp.opengl.util.TileRendererBase.

Definition at line 280 of file TileRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setImageSize()

final void com.jogamp.opengl.util.TileRenderer.setImageSize ( final int  width,
final int  height 
)

Sets the desired size of the final image.

Parameters
widthThe width of the final image
heightThe height of the final image

Implementation reset() internal states.

Reimplemented from com.jogamp.opengl.util.TileRendererBase.

Definition at line 168 of file TileRenderer.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRowOrder()

final void com.jogamp.opengl.util.TileRenderer.setRowOrder ( final int  order)

Sets the order of row traversal, default is TR_BOTTOM_TO_TOP.

Parameters
orderThe row traversal order, must be either TR_TOP_TO_BOTTOM or TR_BOTTOM_TO_TOP.

Definition at line 352 of file TileRenderer.java.

◆ setTileOffset()

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.

See also
TR_TILE_X_OFFSET
TR_TILE_Y_OFFSET

Definition at line 258 of file TileRenderer.java.

◆ setTileSize()

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.

Parameters
widthThe width of the tiles. Must not be larger than the GL context
heightThe height of the tiles. Must not be larger than the GL context
borderThe 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tileDetails()

StringBuilder com.jogamp.opengl.util.TileRenderer.tileDetails ( final StringBuilder  sb)
protected

Reimplemented from com.jogamp.opengl.util.TileRendererBase.

Definition at line 148 of file TileRenderer.java.

Here is the call graph for this function:

Member Data Documentation

◆ TR_BOTTOM_TO_TOP

final int com.jogamp.opengl.util.TileRenderer.TR_BOTTOM_TO_TOP = 21
static

Indicates we are traversing rows from the bottom to the top (default).

See getParam(int).

Definition at line 126 of file TileRenderer.java.

◆ TR_COLUMNS

final int com.jogamp.opengl.util.TileRenderer.TR_COLUMNS = 15
static

The number of columns of tiles.

See getParam(int).

Definition at line 102 of file TileRenderer.java.

◆ TR_CURRENT_COLUMN

final int com.jogamp.opengl.util.TileRenderer.TR_CURRENT_COLUMN = 18
static

The current column number.

See getParam(int).

Definition at line 114 of file TileRenderer.java.

◆ TR_CURRENT_ROW

final int com.jogamp.opengl.util.TileRenderer.TR_CURRENT_ROW = 17
static

The current row number.

See getParam(int).

Definition at line 110 of file TileRenderer.java.

◆ TR_CURRENT_TILE_NUM

final int com.jogamp.opengl.util.TileRenderer.TR_CURRENT_TILE_NUM = 16
static

The current tile number.

Has value -1 if eot(). See getParam(int).

Definition at line 106 of file TileRenderer.java.

◆ TR_IMAGE_CLIPPING_HEIGHT

final int com.jogamp.opengl.util.TileRenderer.TR_IMAGE_CLIPPING_HEIGHT = 8
static

The height of the final clipped image.

See getParam(int).

Definition at line 74 of file TileRenderer.java.

◆ TR_IMAGE_CLIPPING_WIDTH

final int com.jogamp.opengl.util.TileRenderer.TR_IMAGE_CLIPPING_WIDTH = 7
static

The width of the final clipped image.

See getParam(int).

Definition at line 70 of file TileRenderer.java.

◆ TR_ROW_ORDER

final int com.jogamp.opengl.util.TileRenderer.TR_ROW_ORDER = 19
static

The order that the rows are traversed.

See getParam(int).

Definition at line 118 of file TileRenderer.java.

◆ TR_ROWS

final int com.jogamp.opengl.util.TileRenderer.TR_ROWS = 14
static

The number of rows of tiles.

See getParam(int).

Definition at line 98 of file TileRenderer.java.

◆ TR_TILE_BORDER

final int com.jogamp.opengl.util.TileRenderer.TR_TILE_BORDER = 11
static

The width of the border around the tiles.

See getParam(int).

Definition at line 86 of file TileRenderer.java.

◆ TR_TILE_HEIGHT

final int com.jogamp.opengl.util.TileRenderer.TR_TILE_HEIGHT = 10
static

The height of the tiles.

See getParam(int).

Definition at line 82 of file TileRenderer.java.

◆ TR_TILE_WIDTH

final int com.jogamp.opengl.util.TileRenderer.TR_TILE_WIDTH = 9
static

The width of the tiles.

See getParam(int).

Definition at line 78 of file TileRenderer.java.

◆ TR_TILE_X_OFFSET

final int com.jogamp.opengl.util.TileRenderer.TR_TILE_X_OFFSET = 12
static

The tiles x-offset.

See getParam(int).

Definition at line 90 of file TileRenderer.java.

◆ TR_TILE_Y_OFFSET

final int com.jogamp.opengl.util.TileRenderer.TR_TILE_Y_OFFSET = 13
static

The tiles y-offset.

See getParam(int).

Definition at line 94 of file TileRenderer.java.

◆ TR_TOP_TO_BOTTOM

final int com.jogamp.opengl.util.TileRenderer.TR_TOP_TO_BOTTOM = 20
static

Indicates we are traversing rows from the top to the bottom.

See getParam(int).

Definition at line 122 of file TileRenderer.java.


The documentation for this class was generated from the following file: