[planetblupi] 05/29: Add a way to change the driver used by the accelerated renderer
Didier Raboud
odyx at moszumanska.debian.org
Tue Jan 2 08:38:41 UTC 2018
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository planetblupi.
commit 54d7eec1a3c7724795d53dbf6856f73c83562146
Author: Mathieu Schroeter <mathieu at schroetersa.ch>
Date: Tue Dec 12 22:43:13 2017 +0100
Add a way to change the driver used by the accelerated renderer
---
src/blupi.cxx | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/src/blupi.cxx b/src/blupi.cxx
index 66f019c..363a70e 100644
--- a/src/blupi.cxx
+++ b/src/blupi.cxx
@@ -78,6 +78,7 @@ enum Settings {
SETTING_TIMERINTERVAL = 1 << 2,
SETTING_RENDERER = 1 << 3,
SETTING_ZOOM = 1 << 4,
+ SETTING_DRIVER = 1 << 5,
};
static int g_settingsOverload = 0;
@@ -177,6 +178,16 @@ ReadConfig ()
g_rendererType = SDL_RENDERER_ACCELERATED;
}
+ if (
+ !(g_settingsOverload & SETTING_DRIVER) && j.find ("driver") != j.end () &&
+ (!g_rendererType || g_rendererType == SDL_RENDERER_ACCELERATED))
+ {
+ if (j["driver"] == "direct3d")
+ SDL_SetHint (SDL_HINT_RENDER_DRIVER, "direct3d");
+ else if (j["driver"] == "opengl")
+ SDL_SetHint (SDL_HINT_RENDER_DRIVER, "opengl");
+ }
+
return true;
}
@@ -570,6 +581,11 @@ parseArgs (int argc, char * argv[], bool & exit)
{"-r", "--renderer"},
"set a renderer [auto;software;accelerated] (default: auto)",
1},
+ {"driver",
+ {"-d", "--driver"},
+ "set a driver [auto;direct3d;opengl] (default: auto, ignored with "
+ "software renderer)",
+ 1},
{"enablerecorder",
{"-c", "--enable-recorder"},
"enable the recorder feature (F3/F4)",
@@ -648,6 +664,17 @@ parseArgs (int argc, char * argv[], bool & exit)
g_settingsOverload |= SETTING_RENDERER;
}
+ if (
+ args["driver"] &&
+ (!g_rendererType || g_rendererType == SDL_RENDERER_ACCELERATED))
+ {
+ if (args["driver"].as<std::string> () == "direct3d")
+ SDL_SetHint (SDL_HINT_RENDER_DRIVER, "direct3d");
+ else if (args["driver"].as<std::string> () == "opengl")
+ SDL_SetHint (SDL_HINT_RENDER_DRIVER, "opengl");
+ g_settingsOverload |= SETTING_DRIVER;
+ }
+
if (args["enablerecorder"])
g_enableRecorder = true;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/planetblupi.git
More information about the Pkg-games-commits
mailing list