![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
"tslacceleratedsurface.h" This class is responsible for drawing the tile specified.
The TSLAcceleratedSurface creates this object and passes it to the TSLAcceleratedRenderControl.
If the user creates a class derived from TSLAcceleratedRenderControl then the derived classes renderTile must call the renderTile() and tileRendered() methods on this class.
The initialise method is provide to allow the contained drawing surface attachment settings to be modified (This is required for X11).
Public Member Functions | |
void | cleanup () |
bool | initialise (void *drawableOrHDC, bool is_hdc_or_pixmap=true, void *display=NULL, void *screen=NULL, Long colourmap=-1, void *visual=NULL) |
void | renderTile (TSLTextureTile *tile) |
void | returnObject (void *object) |
void | tileRendered (TSLTextureTile *tile, bool renderTileNow=false, bool createDisplayListNow=false) |
void TSLAcceleratedRenderer::cleanup | ( | ) |
Clean up the resources allocated by the initialise method.
bool TSLAcceleratedRenderer::initialise | ( | void * | drawableOrHDC, |
bool | is_hdc_or_pixmap = true, | ||
void * | display = NULL, | ||
void * | screen = NULL, | ||
Long | colourmap = -1, | ||
void * | visual = NULL ) |
This method is called from a derived TSLAcceleratedRenderControl to reset the TSLDrawingSurface draw attachments.
This is required for X11 targets when the render control does not block to setup a secondary Display connection to the X-Server.
drawableOrHDC | A drawable (X11) or HDC (windows) |
is_hdc_or_pixmap | true if a hdc or drawable. |
display | X11 display connection |
screen | Associated X11 Screen pointer |
colourmap | Associated X11 colourmap |
visual | Associated X11 Visual pointer |
Notes |
You only have to call this method if you have created your own Render Control.
On X11 for a multi-threaded Render Control you must open a separate Display connection and create all X11 resources via this display connection for the Render Control.
void TSLAcceleratedRenderer::renderTile | ( | TSLTextureTile * | tile | ) |
Calls the background renderer to draw the specified tile.
This method only needs to be called if you implement your own Render Control.
You should then pass on the tile you receive in your TSLAcceleratedRender Control::renderTile(tile) method to this method.
void TSLAcceleratedRenderer::returnObject | ( | void * | object | ) |
This method is called by the Accelerated Surface to return an object to the Accelerated Renderer cache.
void TSLAcceleratedRenderer::tileRendered | ( | TSLTextureTile * | tile, |
bool | renderTileNow = false, | ||
bool | createDisplayListNow = false ) |
This method must be called after the renderTile() method to inform the TSLAcceleratedSurface that the tile has been rendered.
The user is responsible for calling this method in a class derived from TSLAcceleratedRenderControl.
The method allows internal house keeping to be done before releasing the Tile back to the Accelerated Surface.
tile : the pointer originally passed to TSLAcceleratedRenderControl::render Tile() and the renderTile() method of this class.
renderTileNow | If set to true the tile is loaded into texture memory in the context of the background thread. |
createDisplayListNow | If set to true the texture is placed into a display list in the context of the background thread. This will only occur if render TileNow is also true. |
Limitations | Loading a tile in a background thread into texture memory may not work with all OpenGL implementations. |
If we are unable to create a background OpenGL context textures will be loaded in the foreground thread.
Load a texture in a background thread may not improve performance.
Creating a display list in the background thread may not work for all OpenGL implementations.
Creating a display list in the background thread context on some graphics cards may not provide a performance boost. Please check that this improves performance before turning this option on.