MCPcopy Create free account
hub / github.com/DISTRHO/DPF / puglSetMatchingBackendForCurrentBuild

Function puglSetMatchingBackendForCurrentBuild

dgl/src/pugl.cpp:239–275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237// DGL specific, assigns backend that matches current DGL build
238
239void puglSetMatchingBackendForCurrentBuild(PuglView* const view)
240{
241 #ifdef DGL_CAIRO
242 puglSetBackend(view, puglCairoBackend());
243 #endif
244 #ifdef DGL_OPENGL
245 puglSetBackend(view, puglGlBackend());
246 #endif
247 #ifdef DGL_VULKAN
248 puglSetBackend(view, puglVulkanBackend());
249 #endif
250
251 if (view->backend != nullptr)
252 {
253 #if defined(DGL_USE_GLES2)
254 puglSetViewHint(view, PUGL_CONTEXT_API, PUGL_OPENGL_ES_API);
255 puglSetViewHint(view, PUGL_CONTEXT_PROFILE, PUGL_OPENGL_CORE_PROFILE);
256 puglSetViewHint(view, PUGL_CONTEXT_VERSION_MAJOR, 2);
257 #elif defined(DGL_USE_GLES3)
258 puglSetViewHint(view, PUGL_CONTEXT_API, PUGL_OPENGL_ES_API);
259 puglSetViewHint(view, PUGL_CONTEXT_PROFILE, PUGL_OPENGL_CORE_PROFILE);
260 puglSetViewHint(view, PUGL_CONTEXT_VERSION_MAJOR, 3);
261 #elif defined(DGL_USE_OPENGL3)
262 puglSetViewHint(view, PUGL_CONTEXT_API, PUGL_OPENGL_API);
263 puglSetViewHint(view, PUGL_CONTEXT_PROFILE, PUGL_OPENGL_CORE_PROFILE);
264 puglSetViewHint(view, PUGL_CONTEXT_VERSION_MAJOR, 3);
265 #elif defined(DGL_OPENGL)
266 puglSetViewHint(view, PUGL_CONTEXT_API, PUGL_OPENGL_API);
267 puglSetViewHint(view, PUGL_CONTEXT_PROFILE, PUGL_OPENGL_COMPATIBILITY_PROFILE);
268 puglSetViewHint(view, PUGL_CONTEXT_VERSION_MAJOR, 2);
269 #endif
270 }
271 else
272 {
273 puglSetBackend(view, puglStubBackend());
274 }
275}
276
277// --------------------------------------------------------------------------------------------------------------------
278// bring view window into the foreground, aka "raise" window

Callers 1

initPreMethod · 0.85

Calls 2

puglGlBackendFunction · 0.50
puglStubBackendFunction · 0.50

Tested by

no test coverage detected