summaryrefslogtreecommitdiff
path: root/src/graphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-21 14:37:03 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-24 21:08:14 +0300
commitec1beaa2ee07368368e9bd45fe400eedc57419eb (patch)
treec8f4792dc2316c7cc852bcf6738dff7557d9b872 /src/graphics.cpp
parent8d4af08b165e10d7e82380074ce733ee9d068c6a (diff)
downloadmanaplus-ec1beaa2ee07368368e9bd45fe400eedc57419eb.tar.gz
manaplus-ec1beaa2ee07368368e9bd45fe400eedc57419eb.tar.bz2
manaplus-ec1beaa2ee07368368e9bd45fe400eedc57419eb.tar.xz
manaplus-ec1beaa2ee07368368e9bd45fe400eedc57419eb.zip
first part of fixes for compilation with SDL2
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r--src/graphics.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 0b4e9be15..51c2c4a24 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -106,6 +106,11 @@ void Graphics::setMainFlags(const int w, const int h, const int bpp,
int Graphics::getOpenGLFlags() const
{
#ifdef USE_OPENGL
+#ifdef USE_SDL2
+ int displayFlags = SDL_WINDOW_OPENGL;
+ if (mFullscreen)
+ displayFlags |= SDL_WINDOW_FULLSCREEN;
+#else
int displayFlags = SDL_ANYFORMAT | SDL_OPENGL;
if (mFullscreen)
@@ -126,6 +131,7 @@ int Graphics::getOpenGLFlags() const
displayFlags |= SDL_NOFRAME;
return displayFlags;
+#endif
#else
return 0;
#endif
@@ -193,6 +199,12 @@ bool Graphics::setOpenGLMode()
int Graphics::getSoftwareFlags() const
{
+#ifdef USE_SDL2
+ int displayFlags = 0;
+
+ if (mFullscreen)
+ displayFlags |= SDL_FULLSCREEN;
+#else
int displayFlags = SDL_ANYFORMAT;
if (mFullscreen)
@@ -207,7 +219,7 @@ int Graphics::getSoftwareFlags() const
if (mNoFrame)
displayFlags |= SDL_NOFRAME;
-
+#endif
return displayFlags;
}