From 2bd9f9074e14cc92961cc1519a326276232bf117 Mon Sep 17 00:00:00 2001 From: mathnerd314 Date: Thu, 3 Sep 2009 19:49:52 +0000 Subject: [PATCH] Option --renderer to select video renderer git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@5913 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- man/man6/supertux2.6 | 3 +++ src/main.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/man/man6/supertux2.6 b/man/man6/supertux2.6 index 7282a0a9b..31d913c8e 100644 --- a/man/man6/supertux2.6 +++ b/man/man6/supertux2.6 @@ -36,6 +36,9 @@ Run SuperTux with given aspect ratio (eg. \-a 4:3) .B \-d, \-\-default Reset video settings to default values (\-g 800x600 \-a auto \-w) .TP +.B \-\-renderer RENDERER +Render the game using the specified video renderer. Valid values are sdl, opengl, and auto (the default). +.TP .B \-\-disable\-sfx Disable sound effects .TP diff --git a/src/main.cpp b/src/main.cpp index 2400ed0a2..47a40f4c3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -224,6 +224,7 @@ static void print_usage(const char* argv0) " -g, --geometry WIDTHxHEIGHT Run SuperTux in given resolution\n" " -a, --aspect WIDTH:HEIGHT Run SuperTux with given aspect ratio\n" " -d, --default Reset video settings to default values\n" + " --renderer RENDERER Use sdl, opengl, or auto to render\n" " --disable-sfx Disable sound effects\n" " --disable-music Disable music\n" " -h, --help Show this help message and quit\n" @@ -343,6 +344,17 @@ static bool parse_commandline(int argc, char** argv) } } } + } else if(arg == "--renderer") { + i += 1; + if(i >= argc) + { + print_usage(argv[0]); + throw std::runtime_error("Need to specify a renderer for renderer argument"); + } + else + { + config->video = get_video_system(argv[i]); + } } else if(arg == "--show-fps") { config->show_fps = true; } else if(arg == "--no-show-fps") { -- 2.11.0