diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-09-03 02:31:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-09-03 02:31:07 +0300 |
commit | 6007cebe8ac49ca4f3d09b6bed5e3d41a197221a (patch) | |
tree | a0ff9b7e4a75dca2d62045d8833249aea0f0450b /src/render/modernopenglgraphics.cpp | |
parent | f43602b237228935ca468dc3388db0ab761ddbbb (diff) | |
download | mv-6007cebe8ac49ca4f3d09b6bed5e3d41a197221a.tar.gz mv-6007cebe8ac49ca4f3d09b6bed5e3d41a197221a.tar.bz2 mv-6007cebe8ac49ca4f3d09b6bed5e3d41a197221a.tar.xz mv-6007cebe8ac49ca4f3d09b6bed5e3d41a197221a.zip |
Add option for create custom OpenGL context.
By default this option disabled, because may create issues.
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) |