CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_framework.h>
Public Member Functions | |
MapRenderer (Framework &aFramework, const void *aNativeWindow=nullptr) | |
void | Draw () |
bool | Valid () const |
bool | Enable (bool aEnable) |
Static Public Member Functions | |
static std::unique_ptr< MapRenderer > | New (Result &aError, Framework &aFramework, const void *aNativeWindow=nullptr) |
A map renderer using OpenGL ES graphics acceleration.
CartoTypeCore::MapRenderer::MapRenderer | ( | Framework & | aFramework, |
const void * | aNativeWindow = nullptr |
||
) |
Constructs a renderer object that can be used to draw a map into a display which supports OpenGL ES drawing. The MapRenderer::Draw function should be called to draw the map. You can use the framework object freely; any calls to functions which affect the view will automatically be reflected by the Draw() function.
If aNativeWindow is non-null it is used to create an EGL context for that window, into which all drawing is done using a separate thread which calls Draw() 30 times per second. This feature is supported on Windows only.
void CartoTypeCore::MapRenderer::Draw | ( | ) |
Draws the map using OpenGL ES.
bool CartoTypeCore::MapRenderer::Enable | ( | bool | aEnable | ) |
Enables or disables drawing by a separate thread. Returns the previous state. This function is intended for users who need the full capacity of the GPU for a period when drawing is unnecessary. When drawing is disabled, draw events can be handled by calls to Draw, but it is also necessary to create a timer to redraw occasionally (e.g., once per second) to allow missing tiles to be created and drawn after pans, zooms and other changes affecting the display.
|
static |
Constructs a MapRenderer object and returns an error rather than throwing an exception.
bool CartoTypeCore::MapRenderer::Valid | ( | ) | const |
Returns true if this map renderer is valid. If it returns false, graphics acceleration is not enabled.