CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
Public Member Functions | Static Public Member Functions | List of all members
CartoTypeCore::MapRenderer Class Reference

#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< MapRendererNew (Result &aError, Framework &aFramework, const void *aNativeWindow=nullptr)
 

Detailed Description

A map renderer using OpenGL ES graphics acceleration.

Constructor & Destructor Documentation

◆ MapRenderer()

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.

Member Function Documentation

◆ Draw()

void CartoTypeCore::MapRenderer::Draw ( )

Draws the map using OpenGL ES.

◆ Enable()

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.

◆ New()

static std::unique_ptr< MapRenderer > CartoTypeCore::MapRenderer::New ( Result aError,
Framework aFramework,
const void *  aNativeWindow = nullptr 
)
static

Constructs a MapRenderer object and returns an error rather than throwing an exception.

◆ Valid()

bool CartoTypeCore::MapRenderer::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: