diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-08-26 23:23:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-08-26 23:54:35 +0300 |
commit | 1fc5869ed9d02eed3aaac4c0ef7c92949c8dee17 (patch) | |
tree | ab99cdcbdf1ebe72c014822051d73705a75d6906 | |
parent | 80437e1e8c6154c99b19a0a7ea6485b0af8b40f1 (diff) | |
download | mv-1fc5869ed9d02eed3aaac4c0ef7c92949c8dee17.tar.gz mv-1fc5869ed9d02eed3aaac4c0ef7c92949c8dee17.tar.bz2 mv-1fc5869ed9d02eed3aaac4c0ef7c92949c8dee17.tar.xz mv-1fc5869ed9d02eed3aaac4c0ef7c92949c8dee17.zip |
add SDL2 renderer logging.
-rw-r--r-- | src/graphics.cpp | 32 | ||||
-rw-r--r-- | src/graphics.h | 4 |
2 files changed, 35 insertions, 1 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp index 5376f2576..4e2129cbf 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -296,6 +296,23 @@ int Graphics::getMemoryUsage() const return 0; } +#ifdef USE_SDL2 +void Graphics::dumpRendererInfo(const char *const str, + const SDL_RendererInfo &info) +{ + logger->log(str, info.name); + logger->log("flags:"); + if (info.flags & SDL_RENDERER_SOFTWARE) + logger->log(" software"); + if (info.flags & SDL_RENDERER_ACCELERATED) + logger->log(" accelerated"); + if (info.flags & SDL_RENDERER_PRESENTVSYNC) + logger->log(" vsync"); + if (info.flags & SDL_RENDERER_TARGETTEXTURE) + logger->log(" texture target"); +} +#endif + bool Graphics::videoInfo() { @@ -303,7 +320,20 @@ bool Graphics::videoInfo() #ifdef USE_SDL2 logger->log("Using video driver: %s", SDL_GetCurrentVideoDriver()); - // +++ SDL_GetRendererInfo can be used for software info + if (mRenderer) + { + SDL_RendererInfo info; + SDL_GetRendererInfo(mRenderer, &info); + dumpRendererInfo("Current SDL renderer name: %s", info); + + const int num = SDL_GetNumRenderDrivers(); + logger->log("Known renderers"); + for (int f = 0; f < num; f ++) + { + if (!SDL_GetRenderDriverInfo(f, &info)) + dumpRendererInfo("renderer name: %s", info); + } + } #else char videoDriverName[65]; if (SDL_VideoDriverName(videoDriverName, 64)) diff --git a/src/graphics.h b/src/graphics.h index 2715ceae2..7dafcbc45 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -362,6 +362,10 @@ class Graphics : public gcn::Graphics virtual unsigned int getBinds() const { return 0; } #endif +#ifdef USE_SDL2 + void dumpRendererInfo(const char *const str, + const SDL_RendererInfo &info); +#endif int mWidth; int mHeight; |