mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-05 00:38:00 +01:00
init: add --fullscreen and --windowed command line options
This commit is contained in:
parent
1ff0d6ddac
commit
63d1ae8bf7
1 changed files with 13 additions and 1 deletions
|
@ -136,15 +136,27 @@ SYMBOL_EXPORT struct Game* libsuperderpy_init(int argc, char** argv, const char*
|
|||
static struct option long_options[] =
|
||||
{
|
||||
{"debug", no_argument, NULL, 'd'},
|
||||
{"fullscreen", no_argument, NULL, 'f'},
|
||||
{"windowed", no_argument, NULL, 'w'},
|
||||
{NULL, 0, NULL, 0},
|
||||
};
|
||||
|
||||
int opt;
|
||||
while ((opt = getopt_long(argc, argv, "d", long_options, NULL)) != -1) {
|
||||
while ((opt = getopt_long(argc, argv, "dfw", long_options, NULL)) != -1) {
|
||||
switch (opt) {
|
||||
case 'd':
|
||||
game->config.debug.enabled = true;
|
||||
break;
|
||||
case 'f':
|
||||
if (!game->config.fullscreen) {
|
||||
game->config.fullscreen = true;
|
||||
}
|
||||
break;
|
||||
case 'w':
|
||||
if (game->config.fullscreen) {
|
||||
game->config.fullscreen = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue