CartoType C++ API 7.8.2, 2022-03-25
for Windows, Linux, Qt and other platforms supporting C++ development
Public Member Functions | List of all members
CartoType::CMapRenderer Class Reference

#include <cartotype_framework.h>

Public Member Functions

 CMapRenderer (CFramework &aFramework, const void *aNativeWindow=nullptr)
void Draw ()
bool Valid () const
bool Enable (bool aEnable)

Detailed Description

A map renderer using OpenGL ES graphics acceleration.

Constructor & Destructor Documentation

◆ CMapRenderer()

CartoType::CMapRenderer::CMapRenderer ( CFramework 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 CMapRenderer::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.

Member Function Documentation

◆ Draw()

void CartoType::CMapRenderer::Draw ( )

Draws the map using OpenGL ES.

◆ Enable()

bool CartoType::CMapRenderer::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.

◆ Valid()

bool CartoType::CMapRenderer::Valid ( ) const

Returns true if this map renderer is valid. If it returns false, graphics acceleration is not enabled.

The documentation for this class was generated from the following file: