pretty debug info and windowed mode
This commit is contained in:
+7
-2
@@ -22,8 +22,9 @@ static void print_help(int status_code) {
|
||||
"[-fc=CFG_PATH] "
|
||||
"[-is=SIZE] "
|
||||
"[-t=TEMPO] "
|
||||
"[--monitor] "
|
||||
"[-m] "
|
||||
"[--demo] "
|
||||
"[-w] "
|
||||
"\n\n"
|
||||
"Fusion Of Real-time Generative Effects.\n\n"
|
||||
"options:\n"
|
||||
@@ -36,7 +37,8 @@ static void print_help(int status_code) {
|
||||
" -is, --internal-size internal texture height (default: 720)\n"
|
||||
" -t, --tempo base tempo (default: 60)\n"
|
||||
" -m, --monitor output monitor\n"
|
||||
" --demo demonstration mode\n");
|
||||
" --demo demonstration mode\n"
|
||||
" -w, --windowed not fullscreen\n");
|
||||
exit(status_code);
|
||||
}
|
||||
|
||||
@@ -82,6 +84,7 @@ Parameters args_parse(int argc, char **argv) {
|
||||
params.base_tempo = 60.0f;
|
||||
params.monitor = false;
|
||||
params.demo = false;
|
||||
params.windowed = false;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
arg = argv[i];
|
||||
@@ -107,6 +110,8 @@ Parameters args_parse(int argc, char **argv) {
|
||||
params.monitor = true;
|
||||
} else if (is_arg(arg, "--demo")) {
|
||||
params.demo = true;
|
||||
} else if (is_arg(arg, "-w") || is_arg(arg, "--windowed")) {
|
||||
params.windowed = true;
|
||||
} else {
|
||||
invalid_arg(arg);
|
||||
}
|
||||
|
||||
+2
-2
@@ -169,8 +169,8 @@ void forge_run(Parameters params) {
|
||||
init_files(params.frag_path, &common_shader_code, fragment_shaders,
|
||||
frag_count);
|
||||
|
||||
window = window_init(PACKAGE " " VERSION, params.screen, error_callback,
|
||||
key_callback);
|
||||
window = window_init(PACKAGE " " VERSION, params.screen, params.windowed,
|
||||
error_callback, key_callback);
|
||||
|
||||
window_get_context(window, &context);
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ typedef struct Parameters {
|
||||
float base_tempo;
|
||||
bool monitor;
|
||||
bool demo;
|
||||
bool windowed;
|
||||
} Parameters;
|
||||
|
||||
typedef struct Vertex {
|
||||
|
||||
+2
-2
@@ -93,7 +93,7 @@ static void use_window(GLFWwindow *window) {
|
||||
glfwSwapInterval(1);
|
||||
}
|
||||
|
||||
Window *window_init(char *title, unsigned char monitor_index,
|
||||
Window *window_init(char *title, unsigned char monitor_index, bool windowed,
|
||||
void (*error_callback)(int, const char *),
|
||||
void (*key_callback)(Window *, int, int, int, int)) {
|
||||
GLFWwindow *window;
|
||||
@@ -101,7 +101,7 @@ Window *window_init(char *title, unsigned char monitor_index,
|
||||
|
||||
init_glfw(error_callback);
|
||||
|
||||
monitor = get_monitor(monitor_index);
|
||||
monitor = windowed ? NULL : get_monitor(monitor_index);
|
||||
|
||||
window = create_window(monitor, title, key_callback);
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
#ifndef WINDOW_H
|
||||
#define WINDOW_H
|
||||
|
||||
Window *window_init(char *title, unsigned char monitor_index,
|
||||
Window *window_init(char *title, unsigned char monitor_index, bool windowed,
|
||||
void (*error_callback)(int, const char *),
|
||||
void (*key_callback)(Window *, int, int, int, int));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user