public class TileRenderer extends TileRendererBase
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.
TileRendererBase.TileRendererNotify
Modifier and Type | Field and Description |
---|---|
static int |
TR_BOTTOM_TO_TOP
Indicates we are traversing rows from the bottom to the top.
|
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_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 a tile.
|
static int |
TR_TILE_WIDTH
The width of a tile.
|
static int |
TR_TOP_TO_BOTTOM
Indicates we are traversing rows from the top to the bottom.
|
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 and Description |
---|
TileRenderer()
Creates a new TileRenderer object
|
Modifier and Type | Method and Description |
---|---|
void |
beginTile(GL gl)
Begins rendering a tile.
|
void |
endTile(GL gl)
Must be called after rendering the scene,
see
TileRendererBase.beginTile(GL) . |
boolean |
eot()
|
int |
getParam(int pname)
Gets the parameters of this TileRenderer object
|
void |
setRowOrder(int order)
Sets the order of row traversal, default is
TR_BOTTOM_TO_TOP . |
void |
setTileOffset(int xoff,
int yoff)
|
void |
setTileSize(int width,
int height,
int border)
Sets the size of the tiles to use in rendering.
|
attachToAutoDrawable, detachFromAutoDrawable, display, getImageBuffer, getImageSize, getTileBuffer, setGLEventListener, setImageBuffer, setImageSize, setTileBuffer, toString, toString
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_ROWS
getParam(int)
.public static final int TR_COLUMNS
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)
.public final void setTileSize(int width, int height, int border)
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)
public final boolean eot()
public final int getParam(int pname)
TileRendererBase
getParam
in class TileRendererBase
pname
- The parameter name that is to be retrievedpublic 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 void beginTile(GL gl) throws IllegalStateException, GLException
TileRendererBase
Methods 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:
tile width
tile height
tile x-pos
tile y-pos
image width
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.
beginTile
in class TileRendererBase
gl
- The gl contextIllegalStateException
- if image-size or pmvMatrixCB has not been setGLException
- if image buffer
is used but gl
instance is < GL2ES3
public void endTile(GL gl) throws IllegalStateException, GLException
TileRendererBase
TileRendererBase.beginTile(GL)
.
Is is highly recommended to perform swapBuffers()
before calling this method.
This is especially true in regards to multisampling offscreen FBO drawables,
where swapBuffers()
triggers the downsampling to the readable sampling sink.
User has to comply with the GL profile requirement.
endTile
in class TileRendererBase
gl
- the gl contextIllegalStateException
- if beginTile(gl) has not been calledGLException
- if image buffer
is used but gl
instance is < GL2ES3
Copyright 2010 JogAmp Community.