From 7dd8770e6ff0817d634f8119028eb30f5d4747bd Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 10 Oct 2013 00:17:53 +0200 Subject: [PATCH] Added full screen option to events test. --- tests/events.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/events.c b/tests/events.c index 320af621..009ea020 100644 --- a/tests/events.c +++ b/tests/events.c @@ -39,6 +39,8 @@ #include #include +#include "getopt.h" + // These must match the input mode defaults static GLboolean closeable = GL_TRUE; @@ -406,10 +408,11 @@ void monitor_callback(GLFWmonitor* monitor, int event) } } -int main(void) +int main(int argc, char** argv) { GLFWwindow* window; - int width, height; + GLFWmonitor* monitor = NULL; + int ch, width, height; setlocale(LC_ALL, ""); @@ -420,7 +423,17 @@ int main(void) printf("Library initialized\n"); - window = glfwCreateWindow(640, 480, "Event Linter", NULL, NULL); + while ((ch = getopt(argc, argv, "f")) != -1) + { + switch (ch) + { + case 'f': + monitor = glfwGetPrimaryMonitor(); + break; + } + } + + window = glfwCreateWindow(640, 480, "Event Linter", monitor, NULL); if (!window) { glfwTerminate();