From 1221d94f39d8258a6314e007ca8878fb3a7a8ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brard?= Date: Wed, 8 Apr 2020 19:52:57 +0200 Subject: [PATCH] EGL shared context support also set if MAGNUM_TARGET_WEBGL is not defined --- .../Platform/WindowlessEglApplication.h | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/Magnum/Platform/WindowlessEglApplication.h b/src/Magnum/Platform/WindowlessEglApplication.h index cdf411afd..35cd55635 100644 --- a/src/Magnum/Platform/WindowlessEglApplication.h +++ b/src/Magnum/Platform/WindowlessEglApplication.h @@ -183,6 +183,25 @@ class WindowlessEglContext::Configuration { #endif /*implicit*/ Configuration(); + + /** + * @brief Creates an OpenGL shared context with @param ctx instead + * of creating a brand new one. + */ + Configuration& setSharedcontext(EGLContext ctx) { + _sharedContext = ctx; + return *this; + } + + /** + * @brief Returns the configuration shared context. + * If this has not been specified, (meaning the configuration uses a new opengl context), + * then returns nullptr + */ + EGLContext sharedContext() const { + return _sharedContext; + } + #ifndef MAGNUM_TARGET_WEBGL /** @@ -255,28 +274,11 @@ class WindowlessEglContext::Configuration { _device = id; return *this; } - /** - * @brief Creates an OpenGL shared context with @param ctx instead - * of creating a brand new one. - */ - Configuration& setSharedcontext(EGLContext ctx) { - _sharedContext = ctx; - return *this; - } - - /** - * @brief Returns the configuration shared context. - * If this has not been specified, (meaning the configuration uses a new opengl context), - * then returns nullptr - */ - EGLContext sharedContext() const { - return _sharedContext; - } #endif private: - #ifndef MAGNUM_TARGET_WEBGL EGLContext _sharedContext{EGL_NO_CONTEXT}; + #ifndef MAGNUM_TARGET_WEBGL Flags _flags; UnsignedInt _device; #endif