From 82cfdce4097472a05f45469df637431738d218ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brard?= Date: Wed, 8 Apr 2020 17:27:37 +0200 Subject: [PATCH] Minor changes for consistency --- src/Magnum/Platform/WindowlessGlxApplication.cpp | 15 +++------------ src/Magnum/Platform/WindowlessGlxApplication.h | 8 +------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/Magnum/Platform/WindowlessGlxApplication.cpp b/src/Magnum/Platform/WindowlessGlxApplication.cpp index 09df5e19d..574f5795d 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.cpp +++ b/src/Magnum/Platform/WindowlessGlxApplication.cpp @@ -40,15 +40,6 @@ namespace Magnum { namespace Platform { WindowlessGlxContext::WindowlessGlxContext(const WindowlessGlxContext::Configuration& configuration, GLContext* const magnumContext) { _display = XOpenDisplay(nullptr); - /** - * The user can choose to create a windowless application with a dedicated OpenGL context - * or give an OpenGL context to create a shared Context instead. - * - * Here, we ask the configuration whether a context has been specified by the user - * (!= nullptr) or not. - */ - GLXContext ctx = configuration.sharedContext(); - /* Check version */ int major, minor; glXQueryVersion(_display, &major, &minor); @@ -103,7 +94,7 @@ WindowlessGlxContext::WindowlessGlxContext(const WindowlessGlxContext::Configura #endif 0 }; - _context = glXCreateContextAttribsARB(_display, configs[0], ctx, True, contextAttributes); + _context = glXCreateContextAttribsARB(_display, configs[0], configuration.sharedContext(), True, contextAttributes); #ifndef MAGNUM_TARGET_GLES /* Fall back to (forward compatible) GL 2.1 if core context creation fails */ @@ -114,7 +105,7 @@ WindowlessGlxContext::WindowlessGlxContext(const WindowlessGlxContext::Configura GLX_CONTEXT_FLAGS_ARB, GLint(flags), 0 }; - _context = glXCreateContextAttribsARB(_display, configs[0], ctx, True, fallbackContextAttributes); + _context = glXCreateContextAttribsARB(_display, configs[0], configuration.sharedContext(), True, fallbackContextAttributes); /* Fall back to (forward compatible) GL 2.1 if we are on binary NVidia/AMD drivers on Linux. Instead of creating forward-compatible context with @@ -151,7 +142,7 @@ WindowlessGlxContext::WindowlessGlxContext(const WindowlessGlxContext::Configura GLX_CONTEXT_FLAGS_ARB, GLint(flags & ~Configuration::Flag::ForwardCompatible), 0 }; - _context = glXCreateContextAttribsARB(_display, configs[0], ctx, True, fallbackContextAttributes); + _context = glXCreateContextAttribsARB(_display, configs[0], configuration.sharedContext(), True, fallbackContextAttributes); } /* Revert back the old context */ diff --git a/src/Magnum/Platform/WindowlessGlxApplication.h b/src/Magnum/Platform/WindowlessGlxApplication.h index 030ade9e4..d2c7fd631 100644 --- a/src/Magnum/Platform/WindowlessGlxApplication.h +++ b/src/Magnum/Platform/WindowlessGlxApplication.h @@ -258,13 +258,7 @@ class WindowlessGlxContext::Configuration { } private: - /** - * If the @ref Configuration opengl context - * is shared with another context, then _sharedContext points to - * this context. - * - * Otherwise = nullptr; - */ + GLXContext _sharedContext{nullptr}; Flags _flags; };