summaryrefslogtreecommitdiff
path: root/src/render/modernopenglgraphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-03 02:31:07 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-03 02:31:07 +0300
commit6007cebe8ac49ca4f3d09b6bed5e3d41a197221a (patch)
treea0ff9b7e4a75dca2d62045d8833249aea0f0450b /src/render/modernopenglgraphics.cpp
parentf43602b237228935ca468dc3388db0ab761ddbbb (diff)
downloadmanaverse-6007cebe8ac49ca4f3d09b6bed5e3d41a197221a.tar.gz
manaverse-6007cebe8ac49ca4f3d09b6bed5e3d41a197221a.tar.bz2
manaverse-6007cebe8ac49ca4f3d09b6bed5e3d41a197221a.tar.xz
manaverse-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.cpp15
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)