Fixed mode setting for tearing test.

master
Camilla Berglund ago%!(EXTRA string=10 years)
parent 38ca109766
commit 8247e6069d
  1. 22
      tests/tearing.c

@ -92,7 +92,7 @@ static void key_callback(GLFWwindow* window, int key, int scancode, int action,
int main(int argc, char** argv)
{
int ch;
int ch, width, height;
float position;
unsigned long frame_count = 0;
double last_time, current_time;
@ -120,9 +120,27 @@ int main(int argc, char** argv)
exit(EXIT_FAILURE);
if (fullscreen)
{
const GLFWvidmode* mode;
monitor = glfwGetPrimaryMonitor();
mode = glfwGetVideoMode(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);
width = mode->width;
height = mode->height;
}
else
{
width = 640;
height = 480;
}
window = glfwCreateWindow(640, 480, "", monitor, NULL);
window = glfwCreateWindow(width, height, "", monitor, NULL);
if (!window)
{
glfwTerminate();

Loading…
Cancel
Save