From f06489d6cbf4a5a178a10584e2a075124afcaeaf Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 16 Sep 2010 05:23:02 +0200 Subject: [PATCH] Fixed flipped error messages, added window positioning, made color calc more weird. --- tests/windows.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/windows.c b/tests/windows.c index 99d48fba..5c5b968e 100644 --- a/tests/windows.c +++ b/tests/windows.c @@ -48,7 +48,8 @@ int main(void) if (!glfwInit()) { - fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError())); + fprintf(stderr, "Failed to initialize GLFW: %s\n", + glfwErrorString(glfwGetError())); exit(EXIT_FAILURE); } @@ -57,12 +58,15 @@ int main(void) windows[i] = glfwOpenWindow(200, 200, GLFW_WINDOWED, titles[i]); if (!windows[i]) { + fprintf(stderr, "Failed to open GLFW window: %s\n", + glfwErrorString(glfwGetError())); glfwTerminate(); - fprintf(stderr, "Failed to open GLFW window: %s\n", glfwErrorString(glfwGetError())); exit(EXIT_FAILURE); } - glClearColor((i & 0x01) ? 1.0 : 0.0, (i & 0x02) ? 1.0 : 0.0, 0.0, 0.0); + glfwSetWindowPos(windows[i], 100 + (i & 1) * 300, 100 + (i >> 1) * 300); + + glClearColor(i & 1, i >> 1, 0.0, 0.0); } while (running)