From c733ab0a2282e5547edf75c263837f2d04472587 Mon Sep 17 00:00:00 2001 From: Doug Binks Date: Sat, 8 Sep 2018 16:38:43 +0200 Subject: [PATCH] Move glfwGetMonitorWorkarea test to monitors This moves the test use of glfwGetMonitorWorkarea from the simple example to the monitors test program. Related to #1322. --- examples/simple.c | 3 --- tests/monitors.c | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/simple.c b/examples/simple.c index ce9c22d7..7752a365 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -79,7 +79,6 @@ int main(void) GLFWwindow* window; GLuint vertex_buffer, vertex_shader, fragment_shader, program; GLint mvp_location, vpos_location, vcol_location; - int workarea_x, workarea_y, workarea_width, workarea_height; glfwSetErrorCallback(error_callback); @@ -132,8 +131,6 @@ int main(void) glVertexAttribPointer(vcol_location, 3, GL_FLOAT, GL_FALSE, sizeof(vertices[0]), (void*) (sizeof(float) * 2)); - glfwGetMonitorWorkarea(glfwGetPrimaryMonitor(), &workarea_x, &workarea_y, &workarea_width, &workarea_height); - printf("Monitor work area: %d, %d, %d, %d\n", workarea_x, workarea_y, workarea_width, workarea_height); while (!glfwWindowShouldClose(window)) { float ratio; diff --git a/tests/monitors.c b/tests/monitors.c index c7fd5c5c..f2df5aa2 100644 --- a/tests/monitors.c +++ b/tests/monitors.c @@ -93,13 +93,16 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action, static void list_modes(GLFWmonitor* monitor) { int count, x, y, width_mm, height_mm, i; + int workarea_x, workarea_y, workarea_width, workarea_height; float xscale, yscale; + const GLFWvidmode* mode = glfwGetVideoMode(monitor); const GLFWvidmode* modes = glfwGetVideoModes(monitor, &count); glfwGetMonitorPos(monitor, &x, &y); glfwGetMonitorPhysicalSize(monitor, &width_mm, &height_mm); glfwGetMonitorContentScale(monitor, &xscale, &yscale); + glfwGetMonitorWorkarea(monitor, &workarea_x, &workarea_y, &workarea_width, &workarea_height); printf("Name: %s (%s)\n", glfwGetMonitorName(monitor), @@ -110,6 +113,8 @@ static void list_modes(GLFWmonitor* monitor) printf("Physical size: %i x %i mm (%0.2f dpi)\n", width_mm, height_mm, mode->width * 25.4f / width_mm); + printf("Monitor work area: pos=(%d,%d) size=(%dx%d)\n", + workarea_x, workarea_y, workarea_width, workarea_height); printf("Modes:\n");