diff options
Diffstat (limited to 'src/render/modernopenglgraphics.cpp')
-rw-r--r-- | src/render/modernopenglgraphics.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/render/modernopenglgraphics.cpp b/src/render/modernopenglgraphics.cpp index 458a9a9f7..1629dbea5 100644 --- a/src/render/modernopenglgraphics.cpp +++ b/src/render/modernopenglgraphics.cpp @@ -1221,12 +1221,19 @@ void ModernOpenGLGraphics::clearScreen() const restrict2 GL_STENCIL_BUFFER_BIT); } -void ModernOpenGLGraphics::createGLContext() restrict2 +void ModernOpenGLGraphics::createGLContext(const bool custom) restrict2 { - if (mGLContext) - SDL::makeCurrentContext(mGLContext); + if (custom) + { + if (mGLContext) + SDL::makeCurrentContext(mGLContext); + else + mGLContext = SDL::createGLContext(mWindow, 3, 3, 0x01); + } else - mGLContext = SDL::createGLContext(mWindow, 3, 3, 0x01); + { + Graphics::createGLContext(false); + } } void ModernOpenGLGraphics::finalize(ImageCollection *restrict const col) |