void GetOptions(int argc, char *argv[],
void (*print_usage_function)(void),
- void (*print_version_function)(void))
+ void (*print_version_function)(void),
+ void (*print_render_drivers_function)(void))
{
char *base_path = getProgramMainDataPath(argv[0], BASE_PATH);
char **argvplus = checked_calloc((argc + 1) * sizeof(char **));
exit(0);
}
+ else if (strncmp(option, "-list-render-drivers", option_len) == 0)
+ {
+ print_render_drivers_function();
+
+ exit(0);
+ }
else if (strPrefix(option, "-D"))
{
options.special_flags = getStringCopy(&option[2]);
void GetOptions(int, char **,
void (*print_usage_function)(void),
- void (*print_version_function)(void));
+ void (*print_version_function)(void),
+ void (*print_render_drivers_function)(void));
void *checked_malloc(unsigned int);
void *checked_calloc(unsigned int);
}
}
+static void print_render_drivers(void)
+{
+ int num_render_drivers = SDL_GetNumRenderDrivers();
+ int i;
+
+ for (i = 0; i < num_render_drivers; i++)
+ {
+ SDL_RendererInfo info;
+
+ if (SDL_GetRenderDriverInfo(i, &info) == 0)
+ Print("- SDL render driver #%d: '%s'\n", i, info.name);
+ }
+}
+
static void InitProgramConfig(char *command_filename)
{
char *program_title = PROGRAM_TITLE_STRING;
InitExitFunction(CloseAllAndExit);
InitPlatformDependentStuff();
- GetOptions(argc, argv, print_usage, print_version);
+ GetOptions(argc, argv, print_usage, print_version, print_render_drivers);
OpenAll();
EventLoop();