|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jogamp.opengl.util.TileRendererBase
com.jogamp.opengl.util.TileRenderer
public class TileRenderer
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.jogamp.opengl.util.TileRendererBase |
|---|
TileRendererBase.TileRendererListener |
| Field Summary | |
|---|---|
static int |
TR_BOTTOM_TO_TOP
Indicates we are traversing rows from the bottom to the top (default). |
static int |
TR_COLUMNS
The number of columns of tiles. |
static int |
TR_CURRENT_COLUMN
The current column number. |
static int |
TR_CURRENT_ROW
The current row number. |
static int |
TR_CURRENT_TILE_NUM
The current tile number. |
static int |
TR_IMAGE_CLIPPING_HEIGHT
The height of the final clipped image. |
static int |
TR_IMAGE_CLIPPING_WIDTH
The width of the final clipped image. |
static int |
TR_ROW_ORDER
The order that the rows are traversed. |
static int |
TR_ROWS
The number of rows of tiles. |
static int |
TR_TILE_BORDER
The width of the border around the tiles. |
static int |
TR_TILE_HEIGHT
The height of the tiles. |
static int |
TR_TILE_WIDTH
The width of the tiles. |
static int |
TR_TILE_X_OFFSET
The tiles x-offset. |
static int |
TR_TILE_Y_OFFSET
The tiles y-offset. |
static int |
TR_TOP_TO_BOTTOM
Indicates we are traversing rows from the top to the bottom. |
| 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 | |
|---|---|
TileRenderer()
Creates a new TileRenderer object |
|
| Method Summary | |
|---|---|
void |
beginTile(GL gl)
Begins rendering a tile. |
void |
clipImageSize(int width,
int height)
Clips the image-size this tile-renderer iterates through, which can be retrieved via getClippedImageSize(). |
void |
endTile(GL gl)
Must be called after rendering the scene, see TileRendererBase.beginTile(GL). |
boolean |
eot()
Returns true if end of tiling has been reached, otherwise false. |
DimensionImmutable |
getClippedImageSize()
Returns the clipped image-size. |
int |
getParam(int pname)
Gets the parameters of this TileRenderer object |
boolean |
isSetup()
Returns true if this instance is setup properly, i.e. |
void |
reset()
Method resets implementation's internal state to start of tiling as required for TileRendererBase.beginTile(GL) if end of tiling has been reached. |
void |
setImageSize(int width,
int height)
Sets the desired size of the final image |
void |
setRowOrder(int order)
Sets the order of row traversal, default is TR_BOTTOM_TO_TOP. |
void |
setTileOffset(int xoff,
int yoff)
Sets an xy offset for the resulting tiles x-pos and y-pos. |
void |
setTileSize(int width,
int height,
int border)
Sets the size of the tiles to use in rendering. |
| Methods inherited from class com.jogamp.opengl.util.TileRendererBase |
|---|
attachAutoDrawable, detachAutoDrawable, display, getAttachedDrawable, getImageBuffer, getImageSize, getTileBuffer, reqPreSwapBuffers, setGLEventListener, setImageBuffer, setTileBuffer, toString, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int TR_IMAGE_CLIPPING_WIDTH
getParam(int).
public static final int TR_IMAGE_CLIPPING_HEIGHT
getParam(int).
public static final int TR_TILE_WIDTH
getParam(int).
public static final int TR_TILE_HEIGHT
getParam(int).
public static final int TR_TILE_BORDER
getParam(int).
public static final int TR_TILE_X_OFFSET
getParam(int).
public static final int TR_TILE_Y_OFFSET
getParam(int).
public static final int TR_ROWS
getParam(int).
public static final int TR_COLUMNS
getParam(int).
public static final int TR_CURRENT_TILE_NUM
eot(). See getParam(int).
public static final int TR_CURRENT_ROW
getParam(int).
public static final int TR_CURRENT_COLUMN
getParam(int).
public static final int TR_ROW_ORDER
getParam(int).
public static final int TR_TOP_TO_BOTTOM
getParam(int).
public static final int TR_BOTTOM_TO_TOP
getParam(int).
| Constructor Detail |
|---|
public TileRenderer()
| Method Detail |
|---|
public final void setImageSize(int width,
int height)
Implementation reset() internal states.
setImageSize in class TileRendererBasewidth - The width of the final imageheight - The height of the final image
public final void clipImageSize(int width,
int height)
getClippedImageSize().
Original image-size stored in this tile-renderer is unmodified.
Implementation reset() internal states.
width - The image-clipping.widthheight - The image-clipping.heightgetClippedImageSize()public final DimensionImmutable getClippedImageSize()
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.
public final void setTileSize(int width,
int height,
int border)
Implementation reset() internal states.
width - The width of the tiles. Must not be larger than the GL
contextheight - The height of the tiles. Must not be larger than the
GL contextborder - The width of the borders on each tile. This is needed
to avoid artifacts when rendering lines or points with
thickness > 1.
public void setTileOffset(int xoff,
int yoff)
x-pos and y-pos.
TR_TILE_X_OFFSET,
TR_TILE_Y_OFFSETpublic final void reset()
TileRendererBase.beginTile(GL) if end of tiling has been reached.
Implementation is a nop where end of tiling is never reached.
TileRenderer are:
TR_ROWSTR_COLUMNSTR_CURRENT_COLUMNTR_CURRENT_ROWTR_CURRENT_TILE_NUMTileRendererBase.TR_CURRENT_TILE_X_POSTileRendererBase.TR_CURRENT_TILE_Y_POSTileRendererBase.TR_CURRENT_TILE_WIDTHTileRendererBase.TR_CURRENT_TILE_HEIGHT
reset in class TileRendererBasepublic final int getParam(int pname)
TileRendererBase
getParam in class TileRendererBasepname - The parameter name that is to be retrieved
public final void setRowOrder(int order)
TR_BOTTOM_TO_TOP.
order - The row traversal order, must be either TR_TOP_TO_BOTTOM or TR_BOTTOM_TO_TOP.public final boolean isSetup()
TileRendererBaseTileRendererBase.setImageSize(int, int) ..,
and ready for TileRendererBase.beginTile(GL).
Otherwise returns false.
isSetup in class TileRendererBasepublic final boolean eot()
end of tiling criteria is implementation specific and may never be reached.
User needs to TileRendererBase.reset() tiling after reaching end of tiling
before calling TileRendererBase.beginTile(GL) again.
end of tiling is reached w/ TileRenderer, if at least one of the following is true:
TR_CURRENT_TILE_NUM is -1TR_COLUMNS or TR_ROWS is 0
eot in class TileRendererBase
public final void beginTile(GL gl)
throws IllegalStateException,
GLException
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 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 tiling has been reached,
user needs to TileRendererBase.reset() tiling before calling this method.
beginTile in class TileRendererBasegl - The gl context
IllegalStateException - if image-size has not been set or
end-of-tiling has been reached.
GLException - if image buffer is used but gl instance is < GL2ES3TileRendererBase.isSetup(),
TileRendererBase.eot(),
TileRendererBase.reset()
public void endTile(GL gl)
throws IllegalStateException,
GLException
TileRendererBaseTileRendererBase.beginTile(GL).
Please consider TileRendererBase.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.
endTile in class TileRendererBasegl - the gl context
IllegalStateException - if beginTile(gl) has not been called
GLException - if image buffer is used but gl instance is < GL2ES3
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||