summaryrefslogtreecommitdiff
path: root/src/render/graphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-17 19:27:22 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-17 20:30:23 +0300
commitd1b6556bd125f52744ff12b8dd2e644a1515205f (patch)
tree6beaf0721bb5293643f3f2fdc1d2ed4287b12b5f /src/render/graphics.cpp
parent4ecdb004e81a459ea63ebd7127e1c945df43f9ce (diff)
downloadplus-d1b6556bd125f52744ff12b8dd2e644a1515205f.tar.gz
plus-d1b6556bd125f52744ff12b8dd2e644a1515205f.tar.bz2
plus-d1b6556bd125f52744ff12b8dd2e644a1515205f.tar.xz
plus-d1b6556bd125f52744ff12b8dd2e644a1515205f.zip
Do actual SDL2 graphics cleanup before exit.
Diffstat (limited to 'src/render/graphics.cpp')
-rw-r--r--src/render/graphics.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp
index 92a9acc36..82a4cbfd6 100644
--- a/src/render/graphics.cpp
+++ b/src/render/graphics.cpp
@@ -107,6 +107,18 @@ RENDER_OPENGL_MGLDEFINES_H
Graphics *mainGraphics A_NONNULLPOINTER = nullptr;
+#ifdef USE_SDL2
+SDL_Renderer *restrict Graphics::mRenderer = nullptr;
+#endif // USE_SDL2
+#ifdef USE_OPENGL
+#ifdef USE_SDL2
+SDL_GLContext Graphics::mGLContext = nullptr;
+#else // USE_SDL2
+
+void *restrict Graphics::mGLContext = nullptr;
+#endif // USE_SDL2
+#endif // USE_OPENGL
+
Graphics::Graphics() :
mWidth(0),
mHeight(0),
@@ -114,12 +126,6 @@ Graphics::Graphics() :
mActualHeight(0),
mClipStack(1000),
mWindow(nullptr),
-#ifdef USE_SDL2
- mRenderer(nullptr),
-#endif // USE_SDL2
-#ifdef USE_OPENGL
- mGLContext(nullptr),
-#endif // USE_OPENGL
mBpp(0),
mAlpha(false),
mFullscreen(false),
@@ -146,6 +152,10 @@ Graphics::Graphics() :
Graphics::~Graphics()
{
endDraw();
+}
+
+void Graphics::cleanUp()
+{
#ifdef USE_SDL2
if (mRenderer)
{