Class RandomTileRenderer
- java.lang.Object
-
- com.jogamp.opengl.util.TileRendererBase
-
- com.jogamp.opengl.util.RandomTileRenderer
-
public class RandomTileRenderer extends TileRendererBase
Variation ofTileRendererw/o using fixed tiles but arbitrary rectangular regions.See
TileRendererBasefor details.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jogamp.opengl.util.TileRendererBase
TileRendererBase.TileRendererListener
-
-
Field Summary
-
Fields inherited from class com.jogamp.opengl.util.TileRendererBase
TR_CURRENT_TILE_HEIGHT, TR_CURRENT_TILE_WIDTH, TR_CURRENT_TILE_X_POS, TR_CURRENT_TILE_Y_POS, TR_IMAGE_HEIGHT, TR_IMAGE_WIDTH
-
-
Constructor Summary
Constructors Constructor Description RandomTileRenderer()Creates a new TileRenderer object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginTile(GL gl)Begins rendering a tile.voiddisplay(int tX, int tY, int tWidth, int tHeight)Rendering one tile, by simply callingGLAutoDrawable.display().voidendTile(GL gl)Must be called after rendering the scene, seeTileRendererBase.beginTile(GL).booleaneot()Returns true if end of tiling has been reached, otherwise false.intgetParam(int pname)Gets the parameters of this TileRenderer objectbooleanisSetup()Returns true if this instance is setup properly, i.e.voidreset()Method resets implementation's internal state to start of tiling as required forTileRendererBase.beginTile(GL)ifend of tilinghas been reached.voidsetTileRect(int tX, int tY, int tWidth, int tHeight)Set the tile rectangle for the subsequent rendering calls.-
Methods inherited from class com.jogamp.opengl.util.TileRendererBase
attachAutoDrawable, detachAutoDrawable, display, getAttachedDrawable, getImageBuffer, getImageSize, getTileBuffer, reqPreSwapBuffers, setGLEventListener, setImageBuffer, setImageSize, setTileBuffer, toString, toString
-
-
-
-
Method Detail
-
getParam
public final int getParam(int pname)
Description copied from class:TileRendererBaseGets the parameters of this TileRenderer object- Specified by:
getParamin classTileRendererBase- Parameters:
pname- The parameter name that is to be retrieved- Returns:
- the value of the parameter
-
setTileRect
public void setTileRect(int tX, int tY, int tWidth, int tHeight) throws IllegalStateException, IllegalArgumentExceptionSet the tile rectangle for the subsequent rendering calls.- Throws:
IllegalArgumentException- is tile x/y are < 0 or tile size is <= 0x0IllegalStateException
-
isSetup
public final boolean isSetup()
Description copied from class:TileRendererBaseReturns true if this instance is setup properly, i.e.TileRendererBase.setImageSize(int, int).., and ready forTileRendererBase.beginTile(GL). Otherwise returns false.- Specified by:
isSetupin classTileRendererBase
-
eot
public 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
TileRendererBase.reset()tiling after reaching end of tiling before callingTileRendererBase.beginTile(GL)again.end of tiling is never reached w/
RandomRileRenderer, i.e. method always returns false.- Specified by:
eotin classTileRendererBase
-
reset
public final void reset()
Method resets implementation's internal state to start of tiling as required forTileRendererBase.beginTile(GL)ifend of tilinghas been reached.Implementation is a nop where
Reset internal states ofend of tilingis never reached.RandomTileRendererare: none.- Specified by:
resetin classTileRendererBase
-
beginTile
public final 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
TileRendererBase.endTile(GL)!The PMV Matrix must be reshaped after this call using:
- Current Viewport
current tile's x-poscurrent tile's y-posfinal image widthfinal image height
Use shall render the scene afterwards, concluded with a call to this renderer
TileRendererBase.endTile(GL).User has to comply with the GL profile requirement.
If
end of tilinghas been reached, user needs toTileRendererBase.reset()tiling before calling this method.- Specified by:
beginTilein classTileRendererBase- Parameters:
gl- The gl context- Throws:
IllegalStateException- ifimage-sizehas not been set ortile-recthas not been set.GLException- ifimage bufferis used butglinstance is <GL2ES3- See Also:
TileRendererBase.isSetup(),TileRendererBase.eot(),TileRendererBase.reset()
-
endTile
public void endTile(GL gl) throws IllegalStateException, GLException
Description copied from class:TileRendererBaseMust be called after rendering the scene, seeTileRendererBase.beginTile(GL).Please consider
TileRendererBase.reqPreSwapBuffers(GLCapabilitiesImmutable)to determine whether you need to performswap-buffersbefore or after calling this method!User has to comply with the GL profile requirement.
- Specified by:
endTilein classTileRendererBase- Parameters:
gl- the gl context- Throws:
IllegalStateException- if beginTile(gl) has not been calledGLException- ifimage bufferis used butglinstance is <GL2ES3
-
display
public void display(int tX, int tY, int tWidth, int tHeight) throws IllegalStateExceptionRendering one tile, by simply callingGLAutoDrawable.display().- Throws:
IllegalStateException- if noGLAutoDrawableisattachedor imageSize is not set
-
-