feat(window): can specify opengl version from args
Clang Build CI / run-no-video (push) Failing after 48s
Clang Lint CI / lint-no-video (push) Failing after 48s
Clang Build CI / run-video (push) Failing after 50s
Clang Build CI / build-release (push) Failing after 1m12s
Clang Lint CI / lint-video (push) Failing after 51s
Clang Build CI / run-no-video (push) Failing after 48s
Clang Lint CI / lint-no-video (push) Failing after 48s
Clang Build CI / run-video (push) Failing after 50s
Clang Build CI / build-release (push) Failing after 1m12s
Clang Lint CI / lint-video (push) Failing after 51s
This commit is contained in:
+24
-3
@@ -7,12 +7,13 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "constants.h"
|
||||
|
||||
#include "args.h"
|
||||
#include "config.h"
|
||||
#include "string.h"
|
||||
|
||||
#define STR_IMPL_(x) #x // stringify argument
|
||||
#define STR(x) STR_IMPL_(x) // indirection to expand argument macros
|
||||
|
||||
static void print_help(int status_code) {
|
||||
puts(
|
||||
PACKAGE
|
||||
@@ -48,6 +49,8 @@ static void print_help(int status_code) {
|
||||
"[--wayland] "
|
||||
"[--cocoa] "
|
||||
"[--win32] "
|
||||
"[-oma=MAJOR] "
|
||||
"[-omi=MINOR] "
|
||||
"\n\n"
|
||||
"Fusion Of Real-time Generative Effects.\n\n"
|
||||
"options:\n"
|
||||
@@ -91,7 +94,13 @@ static void print_help(int status_code) {
|
||||
" --x11 force X11 GLFW backend\n"
|
||||
" --wayland force Wayland GLFW backend\n"
|
||||
" --cocoa force Cocoa GLFW backend\n"
|
||||
" --win32 force Win32 GLFW backend\n");
|
||||
" --win32 force Win32 GLFW backend\n"
|
||||
" -oma, --opengl-major-version OpenGL major version "
|
||||
"(default: " STR(
|
||||
OPENGL_MAJOR_VERSION) ")\n"
|
||||
" -omi, --opengl-minor-version OpenGL "
|
||||
"minor version (default: " STR(
|
||||
OPENGL_MINOR_VERSION) ")\n");
|
||||
exit(status_code);
|
||||
}
|
||||
|
||||
@@ -163,6 +172,8 @@ void args_parse(Parameters *params, int argc, char **argv) {
|
||||
params->trace_midi = false;
|
||||
params->trace_fps = false;
|
||||
params->glfw_backend = GLFW_BACKEND_ANY;
|
||||
params->opengl_major = OPENGL_MAJOR_VERSION;
|
||||
params->opengl_minor = OPENGL_MINOR_VERSION;
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
arg = argv[i];
|
||||
@@ -239,6 +250,16 @@ void args_parse(Parameters *params, int argc, char **argv) {
|
||||
params->glfw_backend = GLFW_BACKEND_COCOA;
|
||||
} else if (is_arg(arg, "--win32")) {
|
||||
params->glfw_backend = GLFW_BACKEND_WIN32;
|
||||
} else if (is_arg(arg, "-oma") || is_arg(arg, "--opengl-major-version")) {
|
||||
params->opengl_major = parse_uint(arg, value);
|
||||
if (params->opengl_major == 0) {
|
||||
invalid_value(arg, value);
|
||||
}
|
||||
} else if (is_arg(arg, "-omi") || is_arg(arg, "--opengl-minor-version")) {
|
||||
params->opengl_minor = parse_uint(arg, value);
|
||||
if (params->opengl_major == 0) {
|
||||
invalid_value(arg, value);
|
||||
}
|
||||
} else {
|
||||
#ifdef VIDEO_IN
|
||||
if (is_arg(arg, "-vi") || is_arg(arg, "--video-in")) {
|
||||
|
||||
Reference in New Issue
Block a user