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 GL and GL2ES3, abstracted to suit TileRenderer and RandomTileRenderer.
The PMV matrix needs to be reshaped in user code
after calling beginTile(GL), See beginTile(GL).
If attaching to an GLAutoDrawable,
the TileRendererListener#reshapeTile(TileRendererBase, int, int, int, int, int, int) method
is being called after beginTile(GL) for each rendered tile.
It's implementation shall reshape the PMV matrix according to beginTile(GL).
Note that image buffer can only be used
in conjunction w/ a GL instance ≥ GL2ES3 passed to beginTile(GL) and endTile(GL).
This is due to setting up the pack row length
for an image width != tile-width, which usually is the case.
Hence a GLException is thrown in both methods,
if using an image buffer
and passing a GL instance < GL2ES3.
Further more, reading back of MSAA buffers is only supported since GL2ES3
since it requires to set the read-buffer.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | TileRendererBase.
Listener for tile renderer events, intended to extend |
| Modifier and Type | Field and Description |
|---|---|
| protected boolean | |
| protected int | |
| protected int | |
| protected int | |
| protected int | |
| pack-priv static final boolean | |
| protected GLAutoDrawable | |
| protected boolean | |
| protected boolean | |
| protected GLEventListener | |
| protected GLEventListener | |
| protected GLPixelBuffer | |
| protected final Dimension | |
| protected GLEventListener[] | |
| protected boolean[] | |
| protected final GLPixelStorageModes | |
| protected GLPixelBuffer | |
| private final GLEventListener | |
| public static final int | TR_CURRENT_TILE_HEIGHT
The height of the current tile. |
| public static final int | TR_CURRENT_TILE_WIDTH
The width of the current tile. |
| public static final int | TR_CURRENT_TILE_X_POS
The x-pos of the current tile. |
| public static final int | TR_CURRENT_TILE_Y_POS
The y-pos of the current tile. |
| public static final int | TR_IMAGE_HEIGHT
The height of the final image. |
| public static final int | TR_IMAGE_WIDTH
The width of the final image. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final void | attachAutoDrawable(final GLAutoDrawable
the glad)GLAutoDrawable to attach.Attaches the given |
| public abstract void | |
| public final void | |
| public final void | |
| public abstract void | |
| public abstract boolean | |
| public final GLAutoDrawable | |
| public final GLPixelBuffer | |
| public final DimensionImmutable | |
| public abstract int | Returns: the value of the parameterThe parameter name that is to be retrieved pname)Gets the parameters of this TileRenderer object |
| public final GLPixelBuffer | |
| private final String | |
| public abstract boolean | isSetup()
Returns true if this instance is setup properly, i.e. |
| public final boolean | reqPreSwapBuffers(final GLCapabilitiesImmutable chosenCaps)
Determines whether the chosen |
| public abstract void | reset()
Method resets implementation's internal state to start of tiling
as required for |
| public final void | setGLEventListener(final GLEventListener
the pre operations preTile, final GLEventListener the post operations postTile)Set |
| public final void | setImageBuffer(final GLPixelBuffer
the buffer itself, must be large enough to hold the final image buffer)Sets the buffer in which to store the final image |
| public void | setImageSize(final int
The width of the final image width, final int The height of the final image height)Sets the desired size of the final image |
| public final void | setTileBuffer(final GLPixelBuffer
The buffer itself. Must be large enough to contain a random tile buffer)Specify a buffer the tiles to be copied to. |
| protected StringBuilder | |
| public StringBuilder | |
| public String | |
| pack-priv final void |
| beginCalled | back to summary |
|---|---|
| protected boolean beginCalled | |
| currentTileHeight | back to summary |
|---|---|
| protected int currentTileHeight | |
| currentTileWidth | back to summary |
|---|---|
| protected int currentTileWidth | |
| currentTileXPos | back to summary |
|---|---|
| protected int currentTileXPos | |
| currentTileYPos | back to summary |
|---|---|
| protected int currentTileYPos | |
| DEBUG | back to summary |
|---|---|
| pack-priv static final boolean DEBUG | |
| glad | back to summary |
|---|---|
| protected GLAutoDrawable glad | |
| gladAutoSwapBufferMode | back to summary |
|---|---|
| protected boolean gladAutoSwapBufferMode | |
| gladRequiresPreSwap | back to summary |
|---|---|
| protected boolean gladRequiresPreSwap | |
| glEventListenerPost | back to summary |
|---|---|
| protected GLEventListener glEventListenerPost | |
| glEventListenerPre | back to summary |
|---|---|
| protected GLEventListener glEventListenerPre | |
| imageBuffer | back to summary |
|---|---|
| protected GLPixelBuffer imageBuffer | |
| imageSize | back to summary |
|---|---|
| protected final Dimension imageSize | |
| listeners | back to summary |
|---|---|
| protected GLEventListener[] listeners | |
| listenersInit | back to summary |
|---|---|
| protected boolean[] listenersInit | |
| psm | back to summary |
|---|---|
| protected final GLPixelStorageModes psm | |
| tileBuffer | back to summary |
|---|---|
| protected GLPixelBuffer tileBuffer | |
| tiledGLEL | back to summary |
|---|---|
| private final GLEventListener tiledGLEL | |
| TR_CURRENT_TILE_HEIGHT | back to summary |
|---|---|
| public static final int TR_CURRENT_TILE_HEIGHT The height of the current tile. See | |
| TR_CURRENT_TILE_WIDTH | back to summary |
|---|---|
| public static final int TR_CURRENT_TILE_WIDTH The width of the current tile. See | |
| TR_CURRENT_TILE_X_POS | back to summary |
|---|---|
| public static final int TR_CURRENT_TILE_X_POS The x-pos of the current tile. See | |
| TR_CURRENT_TILE_Y_POS | back to summary |
|---|---|
| public static final int TR_CURRENT_TILE_Y_POS The y-pos of the current tile. See | |
| TR_IMAGE_HEIGHT | back to summary |
|---|---|
| public static final int TR_IMAGE_HEIGHT The height of the final image. See | |
| TR_IMAGE_WIDTH | back to summary |
|---|---|
| public static final int TR_IMAGE_WIDTH The width of the final image. See | |
| TileRendererBase | back to summary |
|---|---|
| protected TileRendererBase() | |
| attachAutoDrawable | back to summary |
|---|---|
| public final void attachAutoDrawable(final GLAutoDrawable glad) throws IllegalStateException Attaches the given
The
The
This tile renderer's internal
Consider using
Call
| |
| beginTile | back to summary |
|---|---|
| public abstract void beginTile(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 The PMV Matrix must be reshaped after this call using:
Use shall render the scene afterwards, concluded with a call to
this renderer User has to comply with the GL profile requirement.
If
| |
| detachAutoDrawable | back to summary |
|---|---|
| public final void detachAutoDrawable() Detaches the given | |
| display | back to summary |
|---|---|
| public final void display() throws IllegalStateException Rendering one tile, by simply calling
| |
| endTile | back to summary |
|---|---|
| public abstract void endTile(GL gl) throws IllegalStateException, GLException Must be called after rendering the scene,
see
Please consider User has to comply with the GL profile requirement.
| |
| eot | back to summary |
|---|---|
| public abstract 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 | |
| getAttachedDrawable | back to summary |
|---|---|
| public final GLAutoDrawable getAttachedDrawable() Returns a previously
If called from | |
| getImageBuffer | back to summary |
|---|---|
public final GLPixelBuffer getImageBuffer()
| |
| getImageSize | back to summary |
|---|---|
public final DimensionImmutable getImageSize()
| |
| getParam | back to summary |
|---|---|
| public abstract int getParam(int pname) throws IllegalArgumentException Gets the parameters of this TileRenderer object
| |
| getTileBuffer | back to summary |
|---|---|
public final GLPixelBuffer getTileBuffer()
| |
| hashStr | back to summary |
|---|---|
| private final String hashStr(final Object o) | |
| isSetup | back to summary |
|---|---|
| public abstract boolean isSetup() Returns true if this instance is setup properly, i.e. | |
| reqPreSwapBuffers | back to summary |
|---|---|
| public final boolean reqPreSwapBuffers(final GLCapabilitiesImmutable chosenCaps) Determines whether the chosen
See | |
| reset | back to summary |
|---|---|
| public abstract void reset() Method resets implementation's internal state to start of tiling
as required for
Implementation is a nop where | |
| setGLEventListener | back to summary |
|---|---|
| public final void setGLEventListener(final GLEventListener preTile, final GLEventListener postTile) Set
| |
| setImageBuffer | back to summary |
|---|---|
| public final void setImageBuffer(final GLPixelBuffer buffer) Sets the buffer in which to store the final image
| |
| setImageSize | back to summary |
|---|---|
| public void setImageSize(final int width, final int height) Sets the desired size of the final image
| |
| setTileBuffer | back to summary |
|---|---|
| public final void setTileBuffer(final GLPixelBuffer buffer) Specify a buffer the tiles to be copied to. This is not necessary for the creation of the final image, but useful if you want to inspect each tile in turn.
| |
| tileDetails | back to summary |
|---|---|
| protected StringBuilder tileDetails(final StringBuilder sb) | |
| toString | back to summary |
|---|---|
| public StringBuilder toString(final StringBuilder sb) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| validateGL | back to summary |
|---|---|
| pack-priv final void validateGL(final GL gl) throws GLException | |
GLEventListener implementations,
enabling tile rendering via TileRendererBase#attachAutoDrawable(GLAutoDrawable).
| Modifier and Type | Method and Description |
|---|---|
| public void | addTileRendererNotify(TileRendererBase
the associated tr)TileRendererBaseThe owning |
| public void | endTileRendering(TileRendererBase
the issuing tr)TileRendererBaseCalled by the |
| public void | removeTileRendererNotify(TileRendererBase
the disassociated tr)TileRendererBaseThe owning |
| public void | reshapeTile(TileRendererBase
the issuing tr, int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight)TileRendererBaseCalled by the |
| public void | startTileRendering(TileRendererBase
the issuing tr)TileRendererBaseCalled by the |
| addTileRendererNotify | back to summary |
|---|---|
| public void addTileRendererNotify(TileRendererBase tr) The owning
The
| |
| endTileRendering | back to summary |
|---|---|
| public void endTileRendering(TileRendererBase tr) Called by the
If
The
| |
| removeTileRendererNotify | back to summary |
|---|---|
| public void removeTileRendererNotify(TileRendererBase tr) The owning
The
| |
| reshapeTile | back to summary |
|---|---|
| public void reshapeTile(TileRendererBase tr, int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight) Called by the The PMV Matrix shall be reshaped according to the given
See details in TileRendererBase#beginTile(GL).
The
| |
| startTileRendering | back to summary |
|---|---|
| public void startTileRendering(TileRendererBase tr) Called by the
If
The
| |