From 224e9205e0909d07df9730fd089db172768f8802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 8 Apr 2019 21:51:21 +0200 Subject: [PATCH] Remove command-line options from tearing test --- tests/CMakeLists.txt | 2 +- tests/tearing.c | 41 +---------------------------------------- 2 files changed, 2 insertions(+), 41 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2e7e49b4..97da4684 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -35,7 +35,7 @@ add_executable(icon WIN32 MACOSX_BUNDLE icon.c ${GLAD_GL}) add_executable(inputlag WIN32 MACOSX_BUNDLE inputlag.c ${GETOPT} ${GLAD_GL}) add_executable(joysticks WIN32 MACOSX_BUNDLE joysticks.c ${GLAD_GL}) add_executable(opacity WIN32 MACOSX_BUNDLE opacity.c ${GLAD_GL}) -add_executable(tearing WIN32 MACOSX_BUNDLE tearing.c ${GETOPT} ${GLAD_GL}) +add_executable(tearing WIN32 MACOSX_BUNDLE tearing.c ${GLAD_GL}) add_executable(threads WIN32 MACOSX_BUNDLE threads.c ${TINYCTHREAD} ${GLAD_GL}) add_executable(timeout WIN32 MACOSX_BUNDLE timeout.c ${GLAD_GL}) add_executable(title WIN32 MACOSX_BUNDLE title.c ${GLAD_GL}) diff --git a/tests/tearing.c b/tests/tearing.c index 63b1bb1b..8b28d396 100644 --- a/tests/tearing.c +++ b/tests/tearing.c @@ -35,7 +35,6 @@ #include #include -#include "getopt.h" #include "linmath.h" static const struct @@ -163,8 +162,6 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action, int main(int argc, char** argv) { unsigned long frame_count = 0; - GLFWmonitor* monitor = NULL; - int ch, width, height; double last_time, current_time; GLFWwindow* window; GLuint vertex_buffer, vertex_shader, fragment_shader, program; @@ -175,46 +172,10 @@ int main(int argc, char** argv) if (!glfwInit()) exit(EXIT_FAILURE); - while ((ch = getopt(argc, argv, "hf")) != -1) - { - switch (ch) - { - case 'h': - usage(); - exit(EXIT_SUCCESS); - - case 'f': - monitor = glfwGetPrimaryMonitor(); - break; - - default: - usage(); - exit(EXIT_FAILURE); - } - } - - if (monitor) - { - const GLFWvidmode* mode = glfwGetVideoMode(monitor); - - glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); - glfwWindowHint(GLFW_RED_BITS, mode->redBits); - glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); - glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); - - width = mode->width; - height = mode->height; - } - else - { - width = 640; - height = 480; - } - glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); - window = glfwCreateWindow(width, height, "Tearing detector", monitor, NULL); + window = glfwCreateWindow(640, 480, "Tearing detector", NULL, NULL); if (!window) { glfwTerminate();