11 #ifndef SDK_VISMAN_SCENE_MANAGER_GL_HELPERS_H_
12 #define SDK_VISMAN_SCENE_MANAGER_GL_HELPERS_H_
16 #include <base/inc/interfaces/parameters/parameters_impl.h>
17 #include <visualizationlayer/inc/vis_const.h>
20 #include <visualizationlayer/inc/gl2d/gl2d_thread_interface.h>
21 #include <visualizationlayer/inc/gl2d/gl2d_ext_created_ctx_interface.h>
30 const std::wstring& name,
32 const ISDKParametersSP& sharable_context,
33 const sdk::gl2d::IGL2DExtCreatedGlCtxSP& ext_created_ctx,
34 const ISceneManagerGLSP& scene_manager_gl,
36 SDKUInt32 scene_width,
37 SDKUInt32 scene_height,
38 double resolution_dpm,
40 ISDKParametersSP& init_params)
42 ISDKParametersSP parameters(
new ParametersMap<ISDKParameters>());
63 init_params = parameters;
69 const std::wstring& name,
71 const ISDKParametersSP& sharable_context,
73 SDKUInt32 scene_width,
74 SDKUInt32 scene_height,
75 double resolution_dpm,
77 ISDKParametersSP& init_params)
80 name, gl_type, sharable_context, sdk::gl2d::IGL2DExtCreatedGlCtxSP(),
81 ISceneManagerGLSP(), texture_format, scene_width, scene_height,
82 resolution_dpm, flags, init_params);
90 const std::wstring& name,
92 const sdk::gl2d::IGL2DThreadSP& gl2d_thread,
93 void*
const get_gl_proc_addr,
94 void*
const gl_lib_handle,
96 SDKUInt32 scene_width,
97 SDKUInt32 scene_height,
98 double resolution_dpm,
100 ISDKParametersSP& init_params)
102 ISDKParametersSP parameters(
new ParametersMap<ISDKParameters>());
107 if (gl2d_thread && get_gl_proc_addr && gl_lib_handle)
111 SDKAny get_gl_proc_addr_any;
113 get_gl_proc_addr_any.vd = get_gl_proc_addr;
116 SDKAny gl_lib_handle_any;
118 gl_lib_handle_any.vd = gl_lib_handle;
128 init_params = parameters;
133 #if defined(SDK_GL2D_USE_WGL) // WGL based OpenGL implementation
134 enum PlatformSpecificGLContextParameter
139 kPlatformSpecificGLContextParameter_HGLRC,
144 inline ISDKParametersSP WrapContext(
145 HGLRC sharable_context)
147 ISDKParametersSP context(
new ParametersMap<>());
148 context->SetParameter(kPlatformSpecificGLContextParameter_HGLRC, SDKAnyHandler(
reinterpret_cast<SDKUInt64
>(sharable_context)));
151 #elif defined(SDK_GL2D_USE_IMX6_EGL) // EGL based OpenGL implementation for iMX6
152 enum PlatformSpecificGLContextParameter
154 kPlatformSpecificGLContextParameter_NativeDisplayType,
155 kPlatformSpecificGLContextParameter_EGLDisplay,
156 kPlatformSpecificGLContextParameter_EGLContext,
158 inline ISDKParametersSP WrapContexts(
159 NativeDisplayType fb_disp,
163 ISDKParametersSP context(
new ParametersMap<>());
164 context->SetParameter(kPlatformSpecificGLContextParameter_NativeDisplayType, SDKAnyHandler(
reinterpret_cast<SDKUInt64
>(fb_disp)));
165 context->SetParameter(kPlatformSpecificGLContextParameter_EGLDisplay, SDKAnyHandler(
reinterpret_cast<SDKUInt64
>(disp)));
166 context->SetParameter(kPlatformSpecificGLContextParameter_EGLContext, SDKAnyHandler(
reinterpret_cast<SDKUInt64
>(ctx)));
169 #elif defined(SDK_GL2D_USE_ANDROID_EGL) // EGL based OpenGL implementation for Android
170 enum PlatformSpecificGLContextParameter
172 kPlatformSpecificGLContextParameter_EGLContext,
177 ISDKParametersSP context(
new ParametersMap<>());
178 context->SetParameter(kPlatformSpecificGLContextParameter_EGLContext, SDKAnyHandler(
reinterpret_cast<SDKUInt64
>(ctx)));
181 #elif defined(SDK_GL2D_USE_EGL) // EGL based OpenGL implementation
182 enum PlatformSpecificGLContextParameter
184 kPlatformSpecificGLContextParameter_EGLContext,
189 ISDKParametersSP context(
new ParametersMap<>());
190 context->SetParameter(kPlatformSpecificGLContextParameter_EGLContext, SDKAnyHandler(
reinterpret_cast<SDKUInt64
>(ctx)));
193 #elif defined(SDK_GL2D_USE_MESA) // Mesa based OpenGL implementation
194 enum PlatformSpecificGLContextParameter
196 kPlatformSpecificGLContextParameter_OSMesaContext,
201 ISDKParametersSP context(
new ParametersMap<>());
202 context->SetParameter(kPlatformSpecificGLContextParameter_OSMesaContext, SDKAnyHandler(
reinterpret_cast<SDKUInt64
>(ctx)));
205 #elif defined(SDK_GL2D_USE_GLX) // GLX based OpenGL implementation
206 enum PlatformSpecificGLContextParameter
208 kPlatformSpecificGLContextParameter_GLXContext,
213 ISDKParametersSP context(
new ParametersMap<>());
214 context->SetParameter(kPlatformSpecificGLContextParameter_GLXContext, SDKAnyHandler(
reinterpret_cast<SDKUInt64
>(ctx)));
217 #else // Fake (unknown) OpenGL platform
218 enum PlatformSpecificGLContextParameter
220 kPlatformSpecificGLContextParameter_UnknownContext,
225 ISDKParametersSP context(
new ParametersMap<>());
226 context->SetParameter(kPlatformSpecificGLContextParameter_UnknownContext,
SDKAnyHandler(ctx));
234 #endif // SDK_VISMAN_SCENE_MANAGER_GL_HELPERS_H_