NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
graphic_context_interface.h
Go to the documentation of this file.
1 
10 #ifndef SDK_VIS_GRAPHIC_CONTEXT_INTERFACE_H_
11 #define SDK_VIS_GRAPHIC_CONTEXT_INTERFACE_H_
12 #pragma once
13 
14 #include <base/inc/platform.h>
15 #include <base/inc/base_types.h>
16 #include <base/inc/forward_declarations.h>
18 #include <base/inc/sdk_ref_ptr.h>
22 #include <geometry/inc/geometry/geometry2d/2d_geometry_objects.h>
23 #include <visualizationlayer/inc/graphics/2d_graphics_objects.h>
24 #include "texture_interface.h"
25 
26 namespace sdk {
27 namespace vis {
28 namespace scene {
29 
30 FWD_DECL_INTERFACE(IGraphicContextFactory);
31 FWD_DECL_INTERFACE(IGraphicContext);
32 FWD_DECL_INTERFACE(IGraphicContextInitialParameters);
33 FWD_DECL_INTERFACE(ITexture);
34 FWD_DECL_INTERFACE(IShader);
35 
38 
50 {
58 };
59 
63 {
67 };
68 
71 
94 {
101 };
102 
107 {
108 public:
109  // No own methods, only ISDKParameters methods
110 
111  SDK_IMPLEMENT_IID(IGraphicContextInitialParameters)
112  SDK_END_INTERFACE(IGraphicContextInitialParameters)
113 };
114 SDK_DECLARE_IID(IGraphicContextInitialParameters)
115 
119 {
120 public:
124  virtual SDKResult SDK_CALLTYPE CreateContext(GraphicContextType type,
125  const IGraphicContextInitialParametersSP& initial_parameters,
126  IGraphicContextSP& context) throw() = 0;
127 
129  virtual SDKResult SDK_CALLTYPE IsContextAvailable(GraphicContextType type) const throw() = 0;
130 
131  SDK_IMPLEMENT_IID(IGraphicContextFactory)
132  SDK_END_INTERFACE(IGraphicContextFactory)
133 };
134 SDK_DECLARE_IID(IGraphicContextFactory)
135 
136 class IGraphicContext : public ISDKProperties
139 {
140 public:
142  virtual GraphicContextType SDK_CALLTYPE GetType() const throw() = 0;
143 
145  virtual SDKResult SDK_CALLTYPE CreateCompatibleContext(IGraphicContextSP& context) throw() = 0;
146 
148  virtual SDKResult SDK_CALLTYPE DiscardResources() throw() = 0;
149 
151  virtual SDKResult SDK_CALLTYPE GetRenderTargetFactory(
152  gfx::RenderTargetFactorySP& rt_factory) throw() = 0;
153 
155  virtual SDKResult SDK_CALLTYPE GetGeometryPathFactory(
156  geometry::GeometryPathFactorySP& geom_factory) throw() = 0;
157 
159  virtual SDKResult SDK_CALLTYPE Create2DTexture(const TextureFormat& format,
160  const SDKSize& size, ITextureSP& texture) throw() = 0;
161 
163  virtual SDKResult SDK_CALLTYPE CreateRenderTarget(const ITextureSP& texture,
164  gfx::RenderTargetSP& render_target) throw() = 0;
165 
166  SDK_IMPLEMENT_IID(IGraphicContext)
167  SDK_END_INTERFACE(IGraphicContext)
168 };
169 SDK_DECLARE_IID(IGraphicContext)
170 
171 } // namespace scene
172 } // namespace vis
173 } // namespace sdk
174 
175 #endif // SDK_VIS_GRAPHIC_CONTEXT_INTERFACE_H_
sdk::vis::scene::kGraphicContextProperty_MSAALevelForNewRT
@ kGraphicContextProperty_MSAALevelForNewRT
MSAA level for new render target on texture.
Definition: graphic_context_interface.h:65
sdk::vis::scene::IGraphicContext::GetType
virtual GraphicContextType SDK_CALLTYPE GetType() const =0
Returns graphics context type.
base_types.h
SDK base types.
sdk::vis::scene::kGraphicContextInitialParameter_DirectXCtx
@ kGraphicContextInitialParameter_DirectXCtx
DirectX context.
Definition: graphic_context_interface.h:95
sdk_ref_ptr.h
Interfaces wrapper with reference count control.
sdk::vis::scene::kGraphicContextInitialParameter_Window
@ kGraphicContextInitialParameter_Window
OS specific window.
Definition: graphic_context_interface.h:99
sdk::vis::scene::IGraphicContext::GetGeometryPathFactory
virtual SDKResult SDK_CALLTYPE GetGeometryPathFactory(geometry::GeometryPathFactorySP &geom_factory)=0
Returns geometry factory (which creates geometry pathes).
properties_interface.h
Object generic properties interface.
sdk::vis::scene::kGraphicContextType_OpenGL
@ kGraphicContextType_OpenGL
context based on OpenGL library (Any OS)
Definition: graphic_context_interface.h:53
sdk::vis::scene::kGraphicContextInitialParameter_DeviceCtx
@ kGraphicContextInitialParameter_DeviceCtx
OS specific device context.
Definition: graphic_context_interface.h:97
sdk::vis::scene::kGraphicContextProperty_DontEraseNewTexture
@ kGraphicContextProperty_DontEraseNewTexture
Don't erase newsly created textures flag.
Definition: graphic_context_interface.h:66
sdk::vis::scene::kGraphicContextProperty_Version
@ kGraphicContextProperty_Version
Changed when resources are discarded.
Definition: graphic_context_interface.h:64
sdk::vis::scene::IGraphicContextFactory::IsContextAvailable
virtual SDKResult SDK_CALLTYPE IsContextAvailable(GraphicContextType type) const =0
Checks, if given context is available for given machine.
sdk::vis::scene::kGraphicContextType_DirectX11
@ kGraphicContextType_DirectX11
DirectX 11 based BackEnd only.
Definition: graphic_context_interface.h:56
sdk::vis::scene::kGraphicContextType_Unknown
@ kGraphicContextType_Unknown
context type is unknown
Definition: graphic_context_interface.h:57
parameters_interface.h
Provides access to members for managing a parameter set.
sdk::ISDKParameters
Provides access to members that manage parameters of an object.
Definition: parameters_interface.h:33
sdk::vis::scene::GraphicContextType
GraphicContextType
Possible types of graphics context, like context based on DirectX or OpenGL.
Definition: graphic_context_interface.h:49
SDKResult
SDKInt32 SDKResult
Type of all error or return codes which SDK functions can end with.
Definition: sdk_results.h:17
texture_interface.h
Definition of graphic texture interfaces.
sdk::ISDKProperties
Provides access to members that control the properties.
Definition: properties_interface.h:32
sdk_component_interface.h
Common base SDK interfaces.
sdk::vis::scene::kGraphicContextType_DirectX10
@ kGraphicContextType_DirectX10
context based on DirectX 10 library (Windows 7 and later)
Definition: graphic_context_interface.h:52
sdk::vis::scene::kGraphicContextType_Software
@ kGraphicContextType_Software
context based on software implementation (Any OS)
Definition: graphic_context_interface.h:54
sdk::vis::scene::GraphicContextPropertiesID
GraphicContextPropertiesID
Set of common graphics context properties.
Definition: graphic_context_interface.h:62
sdk::vis::scene::IGraphicContext::CreateCompatibleContext
virtual SDKResult SDK_CALLTYPE CreateCompatibleContext(IGraphicContextSP &context)=0
Creates context compatible to current one.
sdk::vis::scene::IGraphicContextInitialParameters
Initial settings to create an appropriate graphics context by factory. No own methods,...
Definition: graphic_context_interface.h:106
platform.h
Describes the platform constants.
sdk::vis::scene::IGraphicContext::Create2DTexture
virtual SDKResult SDK_CALLTYPE Create2DTexture(const TextureFormat &format, const SDKSize &size, ITextureSP &texture)=0
Creates special texture which can be used as source for render target.
sdk::vis::scene::kGraphicContextType_Auto
@ kGraphicContextType_Auto
context is chosen automatically
Definition: graphic_context_interface.h:51
sdk::vis::scene::kGraphicContextInitialParameter_Display
@ kGraphicContextInitialParameter_Display
OS specific display.
Definition: graphic_context_interface.h:98
sdk::vis::scene::GraphicContextInitialParametersID
GraphicContextInitialParametersID
Initialization parameters for OpenGL/DirectX based contexts.
Definition: graphic_context_interface.h:93
ISDKComponent
Base interface for all SDK interfaces.
Definition: sdk_component_interface.h:41
geometry_base_types.h
Geometry base types.
sdk::vis::scene::IGraphicContext::GetRenderTargetFactory
virtual SDKResult SDK_CALLTYPE GetRenderTargetFactory(gfx::RenderTargetFactorySP &rt_factory)=0
Returns render target factory (which creates graphics objects).
sdk::vis::scene::kGraphicContextInitialParameter_VisualInfo
@ kGraphicContextInitialParameter_VisualInfo
OS specific Visual info.
Definition: graphic_context_interface.h:100
sdk::vis::scene::IGraphicContext::DiscardResources
virtual SDKResult SDK_CALLTYPE DiscardResources()=0
Should be called if client finds out that device is lost.
sdk::vis::scene::IGraphicContextFactory::CreateContext
virtual SDKResult SDK_CALLTYPE CreateContext(GraphicContextType type, const IGraphicContextInitialParametersSP &initial_parameters, IGraphicContextSP &context)=0
Creates graphic context according to a specified type. If type is 'Auto' the most suitable context fo...
sdk::vis::scene::IGraphicContext::CreateRenderTarget
virtual SDKResult SDK_CALLTYPE CreateRenderTarget(const ITextureSP &texture, gfx::RenderTargetSP &render_target)=0
Create render target on texture.
sdk::vis::scene::kGraphicContextInitialParameter_OpenGLCtx
@ kGraphicContextInitialParameter_OpenGLCtx
OS specific OpenGL context.
Definition: graphic_context_interface.h:96
sdk::vis::scene::kGraphicContextType_DirectX9
@ kGraphicContextType_DirectX9
DirectX 9 based BackEnd only.
Definition: graphic_context_interface.h:55
SDKSize
SizeUI.
Definition: geometry_base_types.h:1235
FWD_DECL_INTERFACE
FWD_DECL_INTERFACE(ILWEParserWrapper)
Provides a wrapper around the message parser to get, add or remove the.
sdk::vis::scene::IGraphicContextFactory
Factory for all graphic context implementations.
Definition: graphic_context_interface.h:118