NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
gl2d_canvas_interface.h File Reference

GL2D Canvas to use to drawing. More...

#include <base/inc/platform.h>
#include <base/inc/base_types.h>
#include <base/inc/sdk_component_base.h>
#include <base/inc/sdk_results_enum.h>
#include <base/inc/geometry/geometry_base_types.h>
#include <base/inc/color/color_base_types.h>
#include <base/inc/math/matrix_base_types.h>
#include <base/inc/interfaces/properties/properties_interface.h>
#include <visualizationlayer/inc/vis_const.h>
#include "./gl2d_canvas_func/gl2d_canvas_utils_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_projection_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_palette_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_radar_image_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_filled_circles_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_pattern_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_textbox_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_bordered_latin1_text_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_latin1_text_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_text_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_line_mark_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_sprites_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_textured_line_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_texture_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_light_source_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_mesh_func_interface.h"
#include "./gl2d_canvas_func/gl2d_canvas_line_func_interface.h"
#include "gl2d_caps_interface.h"
#include "gl2d_stats_interface.h"
#include "gl2d_draw_stats_interface.h"
#include "gl2d_textures_storage_interface.h"
#include "gl2d_font_interface.h"
#include "gl2d_clip_rule_interface.h"
#include "gl2d_thread_interface.h"
#include "gl2d_objects.h"

Go to the source code of this file.

Data Structures

class  IGL2DCanvas
 GL2D Canvas to use to drawing NOTE! Create/Draw functionality was moved to appropriate GL2D Canvas Func interface. More...
 
class  AutoLockUnlockCanvas
 Auto locks Canvas in ctor, unlocks in dtor. More...
 
class  AutoStartFinishDraw
 Auto starts draw in ctor, finishes in dtor. More...
 
class  AutoApplyObjectsMatrix
 Applies objects transformation matrix on ctor, removes on dtor. More...
 
class  AutoApplyCanvasClipRule
 Applies canvas clip rule on ctor, removes on dtor. More...
 

Enumerations

enum  GL2DCanvasPropertyIDs {
  kGL2DCanvasPropertyID_RootShadersFolder = 0 , kGL2DCanvasPropertyID_DefAntiAliasingWidth = 2, kGL2DCanvasPropertyID_DefFontBorderWidth = 3, kGL2DCanvasPropertyID_DefLineSmoothAngle = 4,
  kGL2DCanvasPropertyID_DefLineRoundAngle = 5, kGL2DCanvasPropertyID_RemoveClipRuleOnDrawFinished = 6, kGL2DCanvasPropertyID_DontCreateNonRenderableObjects = 7, kGL2DCanvasPropertyID_AllowCreateCompatibleObject = 8,
  kGL2DCanvasPropertyID_AdjustTextPosition = 9, kGL2DCanvasPropertyID_AdjustLatin1TextPosition = 10, kGL2DCanvasPropertyID_TextsBlurring = 11, kGL2DCanvasPropertyID_MaxOzCoordinateValue = 12,
  kGL2DCanvasPropertyID_CurrentDrawCycleNum = 13, kGL2DCanvasPropertyID_AutoAcquireReleaseDrawLock = 14, kGL2DCanvasPropertyID_PolygonsAsLines = 100, kGL2DCanvasPropertyID_Use32BitsTexturesForTexts = 101,
  kGL2DCanvasPropertyID_TextTexturesAtlasBlockSize = 102, kGL2DCanvasPropertyID_TextTexturesAtlasTextureWidth = 103, kGL2DCanvasPropertyID_TextTexturesAtlasTextureHeight = 104, kGL2DCanvasPropertyID_AllowExpandSymbolTexture = 105,
  kGL2DCanvasPropertyID_UseHighPriorityForGLThreads = 106, kGL2DCanvasPropertyID_CacheCleanupTimeout = 107, kGL2DCanvasPropertyID_CachedSymbolsCount = 108, kGL2DCanvasPropertyID_CachedCharMapsCount = 109,
  kGL2DCanvasPropertyID_CachedGLBuffersCount = 110
}
 Generic GL2D Canvas properties. More...
 
enum  GL2DPlatformType
 OpenGL platform type.
 
enum  GL2DCanvasType
 OpenGL canvas type.
 
enum  GL2DDeviceType
 Device type (generic, iPhone, Samsung etc)
 
enum  GL2DCacheType
 Cache type.
 
enum  GL2DCreateCanvasSettingIDs {
  kGL2DCreateCanvasSettingIDs_GlThread = 1, kGL2DCreateCanvasSettingIDs_GetGlProcAddr = 2 , kGL2DCreateCanvasSettingIDs_ExtCreatedCtx = 4, kGL2DCreateCanvasSettingIDs_UseSameCtxForResourceAndDrawing = 10,
  kGL2DCreateCanvasSettingIDs_LogDirectory = 100, kGL2DCreateCanvasSettingIDs_CheckGlCalls = 101, kGL2DCreateCanvasSettingIDs_BreakOnGlError = 102, kGL2DCreateCanvasSettingIDs_LogGlCalls = 103,
  kGL2DCreateCanvasSettingIDs_LogGlCallPerf = 104, kGL2DCreateCanvasSettingIDs_LogGlTasks = 105, kGL2DCreateCanvasSettingIDs_LogGlThreadUsage = 106
}
 Available settings for new canvas. More...
 

Variables

static const SDKColorF kGL2DTransparentClr = { 0.0f, 0.0f, 0.0f, 0.0f }
 100% transparent color
 
static const SDKColorF kGL2DWhiteClr = { 1.0f, 1.0f, 1.0f, 1.0f }
 100% opaque white color
 
static const SDKVertex3D kGL2DUndefinedPosition
 Undefined position.
 
static const float kGL2DCanvasDefTextBorderWidth = 2.0f
 Default text border width for bordered texts.
 

Detailed Description

GL2D Canvas to use to drawing.

Copyright © The Navtor SDK 2011-2016. All Rights Reserved.

Author
The Navtor SDK authors
Date
01/2016
Maintenance:
The Navtor SDK authors

Enumeration Type Documentation

◆ GL2DCanvasPropertyIDs

Generic GL2D Canvas properties.

Enumerator
kGL2DCanvasPropertyID_RootShadersFolder 

Path to root shaders folder Given folder should contain sub-folders with shader programs/routines for OpenGL/ES2 named "gl", "gles" and "common" IN CASE PATH IS RELATIVE - IT SHOULD BE RELATIVE TO MODULE LOCATION, NOT TO EXECUTABLE LOCATION kSDKAnyType_SDKStringPtr Monitor DPI value (used for font rendering) Changing of DPI does not affects already created objects, only newly created objects will use new DPI value kSDKAnyType_Uint32

kGL2DCanvasPropertyID_DefAntiAliasingWidth 

Default additional width to lines for anti-aliasing effect Each side of line will be expanded by half of given value in pixels kSDKAnyType_Float Default font border width for bordered texts, in pixels Changing of border size does not affects already created objects, only newly created objects will use new border width value kSDKAnyType_Float

kGL2DCanvasPropertyID_DefFontBorderWidth 

Default smooth angle value for lines with pattern, in degrees, 0 - 180 In case line has pattern (dash/texture), smooth angle criteria can be specified, in case line joins angle is less than defined value, pattern will be used instead of any specific connection lines Changing of smooth angle does not affects already created objects, only newly created objects will use new value kSDKAnyType_Float

kGL2DCanvasPropertyID_DefLineSmoothAngle 

Default round angle value for textured lines, in degrees, 0 - 180 In case join angle between two line segments <= given angle - round join will be used, if join angle > given angle - butt join will be used Changing of round angle does not affects already created objects, only newly created objects will use new value kSDKAnyType_Float

kGL2DCanvasPropertyID_DefLineRoundAngle 

Removes applied clip rule when draw is finished (at FinishDraw call) kSDKAnyType_Bool

kGL2DCanvasPropertyID_RemoveClipRuleOnDrawFinished 

Do not create objects (meshes/lines/etc) which can't be rendered (See IGL2DCaps::IsCanvasOperationSupported method) kSDKAnyType_Bool

kGL2DCanvasPropertyID_DontCreateNonRenderableObjects 

Allows to create compatible object, in case original object can't be rendered (for example Fash dash line instead of Rougier dash line, in case Rougier dash line rendering is not supported) (See IGL2DCaps::IsCanvasOperationSupported method) kSDKAnyType_Bool

kGL2DCanvasPropertyID_AllowCreateCompatibleObject 

Allows to adjust text position during text rendering (Rounds fractional text position coordinates to integer one) Given flag is for Simple/Bordered/Latin1 bordered/Texts collection texts, for Latin1 texts see kGL2DCanvasPropertyID_AdjustLatin1TextPosition below kSDKAnyType_Bool

kGL2DCanvasPropertyID_AdjustTextPosition 

Allows to adjust Latin1 text position during text rendering (Rounds fractional text position coordinates to integer one) Given flag is for Latin1 texts rendering only kSDKAnyType_Bool

kGL2DCanvasPropertyID_AdjustLatin1TextPosition 

Allows to use filtering (blurring) for texts. If true - texts can be blurred, but always have fixed position If false - texts looks sharp, but will jitter due of their position kSDKAnyType_Bool

kGL2DCanvasPropertyID_TextsBlurring 

Max Oz coordinate value (depth/height) kSDKAnyType_Uint32

kGL2DCanvasPropertyID_MaxOzCoordinateValue 

Current draw cycle number (Number of calls to StartDraw method) kSDKAnyType_Uint64, Get only

kGL2DCanvasPropertyID_CurrentDrawCycleNum 

Auto acquire draw lock in case StartDraw call has passed, auto release previously acquired draw lock on FinishDraw call If one thread started rendering by calling StartDraw another one thread will hang on it's call to StartDraw till previously started rendering will not be finished kSDKAnyType_Bool, false by default

kGL2DCanvasPropertyID_AutoAcquireReleaseDrawLock 

Following properties mostly for debugging purposes and should not be changed in most cases

kGL2DCanvasPropertyID_PolygonsAsLines 

Present polygons as lines only (debug mode, OpenGL only) kSDKAnyType_Bool Use 32 bits full colored RGBA textures instead of 8 bits for internal text texture Only for debug/testing purposes, don't change this property, otherwise each text object will use additional video-memory without any profit kSDKAnyType_Bool

kGL2DCanvasPropertyID_Use32BitsTexturesForTexts 

Text textures atlas block size, in pixels, same for width and height 16 pixels by default, should not be changed in most of cases Affects only newsly created text collections kSDKAnyType_Uint32

kGL2DCanvasPropertyID_TextTexturesAtlasBlockSize 

Text textures atlas texture width, in pixels 2048 pixels by default, should not be changed in most of cases Affects only newsly created text collections kSDKAnyType_Uint32

kGL2DCanvasPropertyID_TextTexturesAtlasTextureWidth 

Text textures atlas texture height, in pixels 1024 pixels by default, should not be changed in most of cases Affects only newsly created text collections kSDKAnyType_Uint32

kGL2DCanvasPropertyID_TextTexturesAtlasTextureHeight 

Allows to expand single text symbol texture with empty strides (one empty stride for top and bottom of each symbol textures) kSDKAnyType_Bool

kGL2DCanvasPropertyID_AllowExpandSymbolTexture 

Use higher priority for OpenGL thread(s) kSDKAnyType_Bool

kGL2DCanvasPropertyID_UseHighPriorityForGLThreads 

Default timeout to clean up unused items from canvas cache(s) kSDKAnyType_Uint32, in seconds

kGL2DCanvasPropertyID_CacheCleanupTimeout 

Returns total number of cached symbol textures kSDKAnyType_Uint32, Get only

kGL2DCanvasPropertyID_CachedSymbolsCount 

Returns total number of cached character map textures kSDKAnyType_Uint32, Get only

kGL2DCanvasPropertyID_CachedCharMapsCount 

Returns total number of cached GL buffers (VBO), which are not in use kSDKAnyType_Uint32, Get only

kGL2DCanvasPropertyID_CachedGLBuffersCount 

Some private properties, mostly for unittests.

◆ GL2DCreateCanvasSettingIDs

Available settings for new canvas.

Enumerator
kGL2DCreateCanvasSettingIDs_GlThread 

IGL2DThreadSP object instance to perform any of OpenGL calls (externally managed OpenGL context, see kGL2DPlatformType_ExternallyManaged) kSDKAnyType_SDKComponentPtr Pointer to appropriate xglGetProcAddress method (wglGetProcAddress/eglGetProcAddress/glXGetProcAddressARB/OSMesaGetProcAddress/etc) (externally managed OpenGL context, see kGL2DPlatformType_ExternallyManaged) kSDKAnyType_UserPtr

kGL2DCreateCanvasSettingIDs_GetGlProcAddr 

Handle to appropriate OpenGL library GetModuleHandleA("opengl32.dll") for Windows, can be NULL for Linux (externally managed OpenGL context, see kGL2DPlatformType_ExternallyManaged) kSDKAnyType_UserPtr

kGL2DCreateCanvasSettingIDs_ExtCreatedCtx 

IGL2DExtCreatedGlCtxSP object instance to create and manage appropriate external application OpenGL context (externally created OpenGL context, see kGL2DPlatformType_ExternallyCreated) kSDKAnyType_SDKComponentPtr

kGL2DCreateCanvasSettingIDs_UseSameCtxForResourceAndDrawing 

Use same OpenGL context for Resource/Drawing contexts flag It's NOT RECOMMENDED to use separate Drawing/Resources contexts (flag = false)

kGL2DPlatformType_ExternallyCreated/kGL2DPlatformType_ExternallyManaged can't use separate contexts (parameter is ignored and always = true) kSDKAnyType_Bool, true by default Common directory for GL calls/performance log files kSDKAnyType_SDKString, temporary OS directory by default

kGL2DCreateCanvasSettingIDs_LogDirectory 

Check each of GL calls for error (performance will be reduced) kSDKAnyType_Bool, false by default

kGL2DCreateCanvasSettingIDs_CheckGlCalls 

Break on GL errors (kGL2DCreateCanvasSettingIDs_CheckGlCalls should be enabled) Crashes application at appropriate faulty GL method call kSDKAnyType_Bool, false by default

kGL2DCreateCanvasSettingIDs_BreakOnGlError 

Log each call to OpenGL subsystem (performance will be reduced) kSDKAnyType_Bool, false by default

kGL2DCreateCanvasSettingIDs_LogGlCalls 

Log performance of each OpenGL subsystem call (performance will be reduced) kSDKAnyType_Bool, false by default

kGL2DCreateCanvasSettingIDs_LogGlCallPerf 

Log each internal GL task start/finish/destroy as well as task run time (performance will be reduced) kSDKAnyType_Bool, false by default

kGL2DCreateCanvasSettingIDs_LogGlTasks 

Log GL thread(s) usage (performance will be reduced) kSDKAnyType_Bool, false by default

kGL2DCreateCanvasSettingIDs_LogGlThreadUsage 

Debug context (performance reduced) - EXPERIMENTAL (WGL only for now) kSDKAnyType_Bool