summaryrefslogtreecommitdiff
path: root/src/graphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-26 23:23:35 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-26 23:54:35 +0300
commit1fc5869ed9d02eed3aaac4c0ef7c92949c8dee17 (patch)
treeab99cdcbdf1ebe72c014822051d73705a75d6906 /src/graphics.cpp
parent80437e1e8c6154c99b19a0a7ea6485b0af8b40f1 (diff)
downloadplus-1fc5869ed9d02eed3aaac4c0ef7c92949c8dee17.tar.gz
plus-1fc5869ed9d02eed3aaac4c0ef7c92949c8dee17.tar.bz2
plus-1fc5869ed9d02eed3aaac4c0ef7c92949c8dee17.tar.xz
plus-1fc5869ed9d02eed3aaac4c0ef7c92949c8dee17.zip
add SDL2 renderer logging.
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r--src/graphics.cpp32
1 files changed, 31 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))