summaryrefslogtreecommitdiff
path: root/src/graphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-21 23:58:06 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-24 21:08:15 +0300
commitbb0281c87995e11dc1cac95009a5253356d94d1a (patch)
treee8b0a1f0f1560dd5d4308f9f7a2d48264ac0ea45 /src/graphics.cpp
parente5521effc043cdf9d781816c0d72bd17830e34f8 (diff)
downloadplus-bb0281c87995e11dc1cac95009a5253356d94d1a.tar.gz
plus-bb0281c87995e11dc1cac95009a5253356d94d1a.tar.bz2
plus-bb0281c87995e11dc1cac95009a5253356d94d1a.tar.xz
plus-bb0281c87995e11dc1cac95009a5253356d94d1a.zip
some SDL2 complilation fixes.
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r--src/graphics.cpp36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 387566013..28d5e09fb 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -106,12 +106,14 @@ 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;
+ int displayFlags = SDL_WINDOW_OPENGL | SDL_WINDOW_OPENGL;
if (mFullscreen)
displayFlags |= SDL_WINDOW_FULLSCREEN;
#else
int displayFlags = SDL_ANYFORMAT | SDL_OPENGL;
+#endif // USE_SDL2
if (mFullscreen)
{
@@ -131,10 +133,12 @@ int Graphics::getOpenGLFlags() const
displayFlags |= SDL_NOFRAME;
return displayFlags;
-#endif
-#else
+
+#else // USE_OPENGL
+
return 0;
-#endif
+#endif // USE_OPENGL
+
}
bool Graphics::setOpenGLMode()
@@ -203,26 +207,23 @@ bool Graphics::setOpenGLMode()
int Graphics::getSoftwareFlags() const
{
#ifdef USE_SDL2
- int displayFlags = 0;
-
- if (mFullscreen)
- displayFlags |= SDL_FULLSCREEN;
+ int displayFlags = SDL_WINDOW_SHOWN;
#else
int displayFlags = SDL_ANYFORMAT;
- if (mFullscreen)
- displayFlags |= SDL_FULLSCREEN;
- else if (mEnableResize)
- displayFlags |= SDL_RESIZABLE;
-
if (mHWAccel)
displayFlags |= SDL_HWSURFACE | SDL_DOUBLEBUF;
else
displayFlags |= SDL_SWSURFACE;
+#endif
+
+ if (mFullscreen)
+ displayFlags |= SDL_FULLSCREEN;
+ else if (mEnableResize)
+ displayFlags |= SDL_RESIZABLE;
if (mNoFrame)
displayFlags |= SDL_NOFRAME;
-#endif
return displayFlags;
}
@@ -261,16 +262,19 @@ int Graphics::getMemoryUsage() const
bool Graphics::videoInfo()
{
- char videoDriverName[65];
logger->log("SDL video info");
+#ifdef USE_SDL2
+ logger->log("Using video driver: %s", SDL_GetCurrentVideoDriver());
+#else
+ char videoDriverName[65];
if (SDL_VideoDriverName(videoDriverName, 64))
logger->log("Using video driver: %s", videoDriverName);
else
logger->log1("Using video driver: unknown");
-
mDoubleBuffer = ((mWindow->flags & SDL_DOUBLEBUF) == SDL_DOUBLEBUF);
logger->log("Double buffer mode: %s", mDoubleBuffer ? "yes" : "no");
+#endif
imageHelper->dumpSurfaceFormat(mWindow);