From 5923efbdeebd3c95cdf7df8224820740904e6676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 17 Jan 2019 19:13:43 +0100 Subject: [PATCH] external: pass GL::Context to flextGLInit(). To make it possible to put driver-specific workaround there. --- src/Magnum/GL/Context.cpp | 9 +++++---- src/Magnum/GL/Context.h | 8 ++++---- src/MagnumExternal/OpenGL/GL/flextGL.h | 3 ++- src/MagnumExternal/OpenGL/GL/flextGL.h.template | 3 ++- src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp | 2 +- .../OpenGL/GL/flextGLPlatform.cpp.template | 2 +- .../OpenGL/GLES2/Emscripten/flextGLEmscripten.h.template | 4 +++- src/MagnumExternal/OpenGL/GLES2/flextGL.h | 3 ++- src/MagnumExternal/OpenGL/GLES2/flextGL.h.template | 3 ++- src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h | 4 +++- src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp | 2 +- .../OpenGL/GLES2/flextGLPlatform.cpp.template | 2 +- src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp | 2 +- .../OpenGL/GLES2/flextGLPlatformIOS.cpp.template | 2 +- .../OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp | 2 +- .../GLES2/flextGLPlatformWindowsDesktop.cpp.template | 2 +- src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h | 3 ++- .../OpenGL/GLES2/flextGLWindowsDesktop.h.template | 3 ++- .../OpenGL/GLES3/Emscripten/flextGLEmscripten.h.template | 4 +++- src/MagnumExternal/OpenGL/GLES3/flextGL.h | 3 ++- src/MagnumExternal/OpenGL/GLES3/flextGL.h.template | 3 ++- src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h | 4 +++- src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp | 2 +- .../OpenGL/GLES3/flextGLPlatform.cpp.template | 2 +- src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp | 2 +- .../OpenGL/GLES3/flextGLPlatformIOS.cpp.template | 2 +- .../OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp | 2 +- .../GLES3/flextGLPlatformWindowsDesktop.cpp.template | 2 +- src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h | 3 ++- .../OpenGL/GLES3/flextGLWindowsDesktop.h.template | 3 ++- 30 files changed, 55 insertions(+), 36 deletions(-) diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index ecdb899d2..fe514bb0e 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -449,9 +449,9 @@ Context& Context::current() { return *currentContext; } -Context::Context(NoCreateT, Int argc, const char** argv, void functionLoader()): Context{NoCreate, Utility::Arguments{"magnum"}, argc, argv, functionLoader} {} +Context::Context(NoCreateT, Int argc, const char** argv, void functionLoader(Context&)): Context{NoCreate, Utility::Arguments{"magnum"}, argc, argv, functionLoader} {} -Context::Context(NoCreateT, Utility::Arguments& args, Int argc, const char** argv, void functionLoader()): _functionLoader{functionLoader}, _version{Version::None} { +Context::Context(NoCreateT, Utility::Arguments& args, Int argc, const char** argv, void functionLoader(Context&)): _functionLoader{functionLoader}, _version{Version::None} { /* Parse arguments */ CORRADE_INTERNAL_ASSERT(args.prefix() == "magnum"); args.addOption("disable-workarounds") @@ -504,8 +504,9 @@ bool Context::tryCreate() { CORRADE_ASSERT(_version == Version::None, "Platform::Context::tryCreate(): context already created", false); - /* Load GL function pointers */ - if(_functionLoader) _functionLoader(); + /* Load GL function pointers. Pass this instance to it so it can use it for + potential driver-specific workarounds. */ + if(_functionLoader) _functionLoader(*this); /* Initialize to something predictable to avoid crashes on improperly created contexts */ diff --git a/src/Magnum/GL/Context.h b/src/Magnum/GL/Context.h index 835063602..51d91d45a 100644 --- a/src/Magnum/GL/Context.h +++ b/src/Magnum/GL/Context.h @@ -667,9 +667,9 @@ class MAGNUM_GL_EXPORT Context { friend Platform::GLContext; #endif - explicit Context(NoCreateT, Int argc, const char** argv, void functionLoader()); - explicit Context(NoCreateT, Utility::Arguments&& args, Int argc, const char** argv, void functionLoader()): Context{NoCreate, args, argc, argv, functionLoader} {} - explicit Context(NoCreateT, Utility::Arguments& args, Int argc, const char** argv, void functionLoader()); + explicit Context(NoCreateT, Int argc, const char** argv, void functionLoader(Context&)); + explicit Context(NoCreateT, Utility::Arguments&& args, Int argc, const char** argv, void functionLoader(Context&)): Context{NoCreate, args, argc, argv, functionLoader} {} + explicit Context(NoCreateT, Utility::Arguments& args, Int argc, const char** argv, void functionLoader(Context&)); bool tryCreate(); void create(); @@ -683,7 +683,7 @@ class MAGNUM_GL_EXPORT Context { MAGNUM_GL_LOCAL bool isCoreProfileImplementationNV(); #endif - void(*_functionLoader)(){}; + void(*_functionLoader)(Context&){}; Version _version; #ifndef MAGNUM_TARGET_WEBGL Flags _flags; diff --git a/src/MagnumExternal/OpenGL/GL/flextGL.h b/src/MagnumExternal/OpenGL/GL/flextGL.h index 129495d07..95c6e3def 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGL.h +++ b/src/MagnumExternal/OpenGL/GL/flextGL.h @@ -28,6 +28,7 @@ #include #include "Magnum/configure.h" +#include "Magnum/GL/GL.h" /* Defensive include guards */ @@ -63,7 +64,7 @@ extern "C" { #ifndef DOXYGEN_GENERATING_OUTPUT /* So the macro names are preserved in the docs */ -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */ diff --git a/src/MagnumExternal/OpenGL/GL/flextGL.h.template b/src/MagnumExternal/OpenGL/GL/flextGL.h.template index 11a4f6aef..1e0714378 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGL.h.template +++ b/src/MagnumExternal/OpenGL/GL/flextGL.h.template @@ -29,6 +29,7 @@ #include #include "Magnum/configure.h" +#include "Magnum/GL/GL.h" /* Defensive include guards */ @@ -64,7 +65,7 @@ extern "C" { #ifndef DOXYGEN_GENERATING_OUTPUT /* So the macro names are preserved in the docs */ -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */ diff --git a/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp b/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp index f2a26135d..51a3cfff8 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp +++ b/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp @@ -30,7 +30,7 @@ #include "Magnum/Platform/Implementation/OpenGLFunctionLoader.h" -void flextGLInit() { +void flextGLInit(Magnum::GL::Context& context) { Magnum::Platform::Implementation::OpenGLFunctionLoader loader; /* GL_ARB_ES3_2_compatibility */ diff --git a/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp.template b/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp.template index e41160c14..833b79b9d 100644 --- a/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp.template +++ b/src/MagnumExternal/OpenGL/GL/flextGLPlatform.cpp.template @@ -31,7 +31,7 @@ #include "Magnum/Platform/Implementation/OpenGLFunctionLoader.h" -void flextGLInit() { +void flextGLInit(Magnum::GL::Context& context) { Magnum::Platform::Implementation::OpenGLFunctionLoader loader; @for category,funcs in functions: @if funcs and category not in ['VERSION_1_0', 'VERSION_1_1']: diff --git a/src/MagnumExternal/OpenGL/GLES2/Emscripten/flextGLEmscripten.h.template b/src/MagnumExternal/OpenGL/GLES2/Emscripten/flextGLEmscripten.h.template index 24ed94af3..0849a6079 100644 --- a/src/MagnumExternal/OpenGL/GLES2/Emscripten/flextGLEmscripten.h.template +++ b/src/MagnumExternal/OpenGL/GLES2/Emscripten/flextGLEmscripten.h.template @@ -26,6 +26,8 @@ DEALINGS IN THE SOFTWARE. */ +#include "Magnum/GL/GL.h" + /* Defensive include guards */ #if defined(__gl2_h_) @@ -46,7 +48,7 @@ extern "C" { #endif -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */ #define APIENTRY diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGL.h b/src/MagnumExternal/OpenGL/GLES2/flextGL.h index 941290695..f8a72db4a 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGL.h @@ -28,6 +28,7 @@ #include #include "Magnum/configure.h" +#include "Magnum/GL/GL.h" /* Defensive include guards */ @@ -50,7 +51,7 @@ extern "C" { #endif -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */ diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGL.h.template b/src/MagnumExternal/OpenGL/GLES2/flextGL.h.template index f0f930d2e..b465c2740 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGL.h.template +++ b/src/MagnumExternal/OpenGL/GLES2/flextGL.h.template @@ -29,6 +29,7 @@ #include #include "Magnum/configure.h" +#include "Magnum/GL/GL.h" /* Defensive include guards */ @@ -51,7 +52,7 @@ extern "C" { #endif -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */ diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h b/src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h index e36424c1b..eb47a02cd 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h @@ -25,6 +25,8 @@ DEALINGS IN THE SOFTWARE. */ +#include "Magnum/GL/GL.h" + /* Defensive include guards */ #if defined(__gl2_h_) @@ -45,7 +47,7 @@ extern "C" { #endif -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */ #define APIENTRY diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp index 68fd0a9ca..ac687633c 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp @@ -30,7 +30,7 @@ #include "Magnum/Platform/Implementation/OpenGLFunctionLoader.h" -void flextGLInit() { +void flextGLInit(Magnum::GL::Context&) { Magnum::Platform::Implementation::OpenGLFunctionLoader loader; /* GL_ANGLE_framebuffer_blit */ diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp.template b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp.template index 5c1f803c4..303ee8fa0 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp.template +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatform.cpp.template @@ -31,7 +31,7 @@ #include "Magnum/Platform/Implementation/OpenGLFunctionLoader.h" -void flextGLInit() { +void flextGLInit(Magnum::GL::Context&) { Magnum::Platform::Implementation::OpenGLFunctionLoader loader; @for category,funcs in functions: @if funcs and category not in ['ES_VERSION_2_0']: diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp index 393d1d6bc..cbf4819ed 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp @@ -152,7 +152,7 @@ #include -void flextGLInit() { +void flextGLInit(Magnum::GL::Context&) { /* Work around missing glTexStorage3D (can't be used anyway because GLES2 on iOS doesn't support OES_texture_3D) */ constexpr void(*glTexStorage3DEXT)() = nullptr; diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp.template b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp.template index ffc30a155..9f2cc4f04 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp.template +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformIOS.cpp.template @@ -36,7 +36,7 @@ #include -void flextGLInit() { +void flextGLInit(Magnum::GL::Context&) { /* Work around missing glTexStorage3D (can't be used anyway because GLES2 on iOS doesn't support OES_texture_3D) */ constexpr void(*glTexStorage3DEXT)() = nullptr; diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp index db1200230..c86977630 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp @@ -30,7 +30,7 @@ #include "Magnum/Platform/Implementation/OpenGLFunctionLoader.h" -void flextGLInit() { +void flextGLInit(Magnum::GL::Context&) { Magnum::Platform::Implementation::OpenGLFunctionLoader loader; /* GL_ANGLE_framebuffer_blit */ diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp.template b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp.template index 5261f4f66..8b7d062e1 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp.template +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLPlatformWindowsDesktop.cpp.template @@ -31,7 +31,7 @@ #include "Magnum/Platform/Implementation/OpenGLFunctionLoader.h" -void flextGLInit() { +void flextGLInit(Magnum::GL::Context&) { Magnum::Platform::Implementation::OpenGLFunctionLoader loader; @for category,funcs in functions: @if funcs: diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h b/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h index 0acbdf19f..0dcb0a915 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h @@ -28,6 +28,7 @@ #include #include "Magnum/configure.h" +#include "Magnum/GL/GL.h" /* Defensive include guards */ @@ -50,7 +51,7 @@ extern "C" { #endif -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */ diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h.template b/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h.template index e95c7c92e..7f5fc9683 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h.template +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h.template @@ -29,6 +29,7 @@ #include #include "Magnum/configure.h" +#include "Magnum/GL/GL.h" /* Defensive include guards */ @@ -51,7 +52,7 @@ extern "C" { #endif -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */ diff --git a/src/MagnumExternal/OpenGL/GLES3/Emscripten/flextGLEmscripten.h.template b/src/MagnumExternal/OpenGL/GLES3/Emscripten/flextGLEmscripten.h.template index 4481b451a..fbf2a7d73 100644 --- a/src/MagnumExternal/OpenGL/GLES3/Emscripten/flextGLEmscripten.h.template +++ b/src/MagnumExternal/OpenGL/GLES3/Emscripten/flextGLEmscripten.h.template @@ -26,6 +26,8 @@ DEALINGS IN THE SOFTWARE. */ +#include "Magnum/GL/GL.h" + /* Defensive include guards */ #if defined(__gl_h_) || defined(__gl2_h_) || defined(__gl3_h_) || defined(__gl31_h_) @@ -51,7 +53,7 @@ extern "C" { #endif -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */ #define APIENTRY diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGL.h b/src/MagnumExternal/OpenGL/GLES3/flextGL.h index 8738b9654..c83e6ba00 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGL.h @@ -28,6 +28,7 @@ #include #include "Magnum/configure.h" +#include "Magnum/GL/GL.h" /* Defensive include guards */ @@ -54,7 +55,7 @@ extern "C" { #endif -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */ diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGL.h.template b/src/MagnumExternal/OpenGL/GLES3/flextGL.h.template index 670f9b0a6..9b58f8fd0 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGL.h.template +++ b/src/MagnumExternal/OpenGL/GLES3/flextGL.h.template @@ -29,6 +29,7 @@ #include #include "Magnum/configure.h" +#include "Magnum/GL/GL.h" /* Defensive include guards */ @@ -55,7 +56,7 @@ extern "C" { #endif -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */ diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h b/src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h index 42a7cae5e..77fc47a79 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h @@ -25,6 +25,8 @@ DEALINGS IN THE SOFTWARE. */ +#include "Magnum/GL/GL.h" + /* Defensive include guards */ #if defined(__gl_h_) || defined(__gl2_h_) || defined(__gl3_h_) || defined(__gl31_h_) @@ -50,7 +52,7 @@ extern "C" { #endif -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */ #define APIENTRY diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp index 405cb0599..777e467dc 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp @@ -30,7 +30,7 @@ #include "Magnum/Platform/Implementation/OpenGLFunctionLoader.h" -void flextGLInit() { +void flextGLInit(Magnum::GL::Context&) { Magnum::Platform::Implementation::OpenGLFunctionLoader loader; /* GL_ES_VERSION_3_1 */ diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp.template b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp.template index f45a016c9..518eeed6b 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp.template +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatform.cpp.template @@ -31,7 +31,7 @@ #include "Magnum/Platform/Implementation/OpenGLFunctionLoader.h" -void flextGLInit() { +void flextGLInit(Magnum::GL::Context&) { Magnum::Platform::Implementation::OpenGLFunctionLoader loader; @for category,funcs in functions: @if funcs and category not in ['ES_VERSION_2_0', 'ES_VERSION_3_0']: diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp index b3fd89f95..b768ddf4c 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp @@ -253,7 +253,7 @@ #include -void flextGLInit() { +void flextGLInit(Magnum::GL::Context&) { /* GL_ES_VERSION_3_1 */ #if GL_ES_VERSION_3_1 diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp.template b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp.template index b9ba20a70..50506f388 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp.template +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformIOS.cpp.template @@ -36,7 +36,7 @@ #include -void flextGLInit() { +void flextGLInit(Magnum::GL::Context&) { @for category,funcs in functions: @if funcs and category not in ['ES_VERSION_2_0', 'ES_VERSION_3_0']: diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp index 1422c1dd9..4fc15b9e1 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp @@ -30,7 +30,7 @@ #include "Magnum/Platform/Implementation/OpenGLFunctionLoader.h" -void flextGLInit() { +void flextGLInit(Magnum::GL::Context&) { Magnum::Platform::Implementation::OpenGLFunctionLoader loader; /* GL_ES_VERSION_2_0 */ diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp.template b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp.template index 5261f4f66..8b7d062e1 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp.template +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLPlatformWindowsDesktop.cpp.template @@ -31,7 +31,7 @@ #include "Magnum/Platform/Implementation/OpenGLFunctionLoader.h" -void flextGLInit() { +void flextGLInit(Magnum::GL::Context&) { Magnum::Platform::Implementation::OpenGLFunctionLoader loader; @for category,funcs in functions: @if funcs: diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h b/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h index b4eb32b7a..bf508e14c 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h @@ -28,6 +28,7 @@ #include #include "Magnum/configure.h" +#include "Magnum/GL/GL.h" /* Defensive include guards */ @@ -54,7 +55,7 @@ extern "C" { #endif -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */ diff --git a/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h.template b/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h.template index 18e277f7d..a12bc1afb 100644 --- a/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h.template +++ b/src/MagnumExternal/OpenGL/GLES3/flextGLWindowsDesktop.h.template @@ -29,6 +29,7 @@ #include #include "Magnum/configure.h" +#include "Magnum/GL/GL.h" /* Defensive include guards */ @@ -55,7 +56,7 @@ extern "C" { #endif -void flextGLInit(); +void flextGLInit(Magnum::GL::Context& context); /* Function declaration macros */