From 91e069f979f7392939f1716017fc73f0dfb263ed Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 12 Feb 2014 14:26:34 +0100 Subject: [PATCH] Desktop mode full screen fixes for tests. --- tests/events.c | 22 ++++++++++++++++++++-- tests/gamma.c | 6 ++++++ tests/iconify.c | 6 ++++++ tests/modes.c | 1 + 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/tests/events.c b/tests/events.c index 4779c6a5..457d7910 100644 --- a/tests/events.c +++ b/tests/events.c @@ -465,7 +465,7 @@ int main(int argc, char** argv) { Slot* slots; GLFWmonitor* monitor = NULL; - int ch, i, count = 1; + int ch, i, width, height, count = 1; setlocale(LC_ALL, ""); @@ -494,6 +494,24 @@ int main(int argc, char** argv) } } + 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; + } + if (!count) { fprintf(stderr, "Invalid user\n"); @@ -511,7 +529,7 @@ int main(int argc, char** argv) sprintf(title, "Event Linter (Window %i)", slots[i].number); - slots[i].window = glfwCreateWindow(640, 480, title, monitor, NULL); + slots[i].window = glfwCreateWindow(width, height, title, monitor, NULL); if (!slots[i].window) { free(slots); diff --git a/tests/gamma.c b/tests/gamma.c index 19dc35df..c67e128a 100644 --- a/tests/gamma.c +++ b/tests/gamma.c @@ -128,6 +128,12 @@ int main(int argc, char** argv) 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; } diff --git a/tests/iconify.c b/tests/iconify.c index 361fe2f5..3cdfd078 100644 --- a/tests/iconify.c +++ b/tests/iconify.c @@ -123,6 +123,12 @@ int main(int argc, char** argv) 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; } diff --git a/tests/modes.c b/tests/modes.c index 76353685..58067e3e 100644 --- a/tests/modes.c +++ b/tests/modes.c @@ -125,6 +125,7 @@ static void test_modes(GLFWmonitor* monitor) glfwWindowHint(GLFW_RED_BITS, mode->redBits); glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits); glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits); + glfwWindowHint(GLFW_REFRESH_RATE, mode->refreshRate); printf("Testing mode %u on monitor %s: %s\n", (unsigned int) i,