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

Definition of graphic context interfaces. More...

#include <base/inc/platform.h>
#include <base/inc/base_types.h>
#include <base/inc/forward_declarations.h>
#include <base/inc/sdk_component_interface.h>
#include <base/inc/sdk_ref_ptr.h>
#include <base/inc/interfaces/properties/properties_interface.h>
#include <base/inc/interfaces/parameters/parameters_interface.h>
#include <base/inc/geometry/geometry_base_types.h>
#include <geometry/inc/geometry/geometry2d/2d_geometry_objects.h>
#include <visualizationlayer/inc/graphics/2d_graphics_objects.h>
#include "texture_interface.h"

Go to the source code of this file.

Data Structures

class  IGraphicContextInitialParameters
 Initial settings to create an appropriate graphics context by factory. No own methods, only ISDKParameters methods. More...
 
class  IGraphicContextFactory
 Factory for all graphic context implementations. More...
 
class  IGraphicContext
 Gives centralized access to all graphic resources. More...
 

Enumerations

enum  GraphicContextType {
  kGraphicContextType_Auto, kGraphicContextType_DirectX10, kGraphicContextType_OpenGL, kGraphicContextType_Software,
  kGraphicContextType_DirectX9, kGraphicContextType_DirectX11, kGraphicContextType_Unknown = 0xFF
}
 Possible types of graphics context, like context based on DirectX or OpenGL. More...
 
enum  GraphicContextPropertiesID { kGraphicContextProperty_Version, kGraphicContextProperty_MSAALevelForNewRT, kGraphicContextProperty_DontEraseNewTexture }
 Set of common graphics context properties. More...
 
enum  GraphicContextInitialParametersID {
  kGraphicContextInitialParameter_DirectXCtx, kGraphicContextInitialParameter_OpenGLCtx, kGraphicContextInitialParameter_DeviceCtx, kGraphicContextInitialParameter_Display,
  kGraphicContextInitialParameter_Window, kGraphicContextInitialParameter_VisualInfo
}
 Initialization parameters for OpenGL/DirectX based contexts. More...
 

Detailed Description

Definition of graphic context interfaces.

Copyright (c) 2011 The NAVTOR SDK. All Rights Reserved.

Author
The NAVTOR SDK authors.
Date
02/2012
Maintenance:
The NAVTOR SDK authors.

Enumeration Type Documentation

◆ GraphicContextType

enum GraphicContextType

Possible types of graphics context, like context based on DirectX or OpenGL.

Some notes about available graphic context types:
The Auto type does not require any of context initial parameters, the appropriate DirectX/OpenGL OS dependent context will be created internally That means that textures created by given graphics context can't be used externally in native DirectX/OpenGL form. This is suitable for backends, based on OS window, where no direct texture in use.
To use the native OpenGL/DirectX texture, the appropriate graphic context should be initialized with proper OpenGL/DirectX context data, in this case all generated textures will be available in the native form.

Enumerator
kGraphicContextType_Auto 

context is chosen automatically

kGraphicContextType_DirectX10 

context based on DirectX 10 library (Windows 7 and later)

kGraphicContextType_OpenGL 

context based on OpenGL library (Any OS)

kGraphicContextType_Software 

context based on software implementation (Any OS)

kGraphicContextType_DirectX9 

DirectX 9 based BackEnd only.

kGraphicContextType_DirectX11 

DirectX 11 based BackEnd only.

kGraphicContextType_Unknown 

context type is unknown

◆ GraphicContextPropertiesID

enum GraphicContextPropertiesID

Set of common graphics context properties.

Enumerator
kGraphicContextProperty_Version 

Changed when resources are discarded.

kGraphicContextProperty_MSAALevelForNewRT 

MSAA level for new render target on texture.

kGraphicContextProperty_DontEraseNewTexture 

Don't erase newsly created textures flag.

◆ GraphicContextInitialParametersID

enum GraphicContextInitialParametersID

Initialization parameters for OpenGL/DirectX based contexts.

Some notes about initial parameters for new graphic context DirectX specific: In case kGraphicContextInitialParameter_DirectXCtx property is not specified, new internal ID3D10Device1 object will be created, all of resources will be created by given internal device.
In case some of DirectX objects, like textures should be used externally, it's recommended to create ID3D10Device1 object externally also and create new graphic context with given D3D10Device passed as initial parameter.
OpenGL specific: In case OS dependent kGraphicContextInitialParameter_DeviceCtx parameter is not specified, new hidden Window will be created.
In case device context is specified, but OpenGL context is not - new OpenGL context, based on device context will be created. In case both of required parameters are specified - they will be used directly, no hidden OpenGL context will be created. In this case all of created by given graphic context objects, like textures, can be used externally as well.
The default parameters for new OpenGL context are OS specific and can't be set via initial parameters, only existing OpenGL context can be passed.
Conclusion: In case generated by graphic context objects, like textures should be used externally - initialize new graphic context with appropriate DirectX/OpenGL objects. In case no objects should be used externally, it's possible to leave graphic context initial parameters empty - new appropriate DirectX/OpenGL context hidden objects will be generated automatically.

Enumerator
kGraphicContextInitialParameter_DirectXCtx 

DirectX context.

kGraphicContextInitialParameter_OpenGLCtx 

OS specific OpenGL context.

kGraphicContextInitialParameter_DeviceCtx 

OS specific device context.

kGraphicContextInitialParameter_Display 

OS specific display.

kGraphicContextInitialParameter_Window 

OS specific window.

kGraphicContextInitialParameter_VisualInfo 

OS specific Visual info.