Skip to content

Instantly share code, notes, and snippets.

@waywardmonkeys
Created June 28, 2013 12:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waywardmonkeys/5884187 to your computer and use it in GitHub Desktop.
Save waywardmonkeys/5884187 to your computer and use it in GitHub Desktop.
module: calvino-glfw3-test-suite
synopsis: Test suite for the calvino-glfw3 library.
define suite calvino-glfw3-test-suite ()
test basics;
end suite;
define test basics ()
glfwInit();
glfwWindowHint($GLFW-VISIBLE, 1);
glfwWindowHint($GLFW-DECORATED, 1);
// let window = glfwCreateWindow(1024, 768, "Test!", null-pointer(<GLFWMonitor*>), null-pointer(<GLFWMonitor*>));
let window = glfwCreateWindow(1024, 768, "Test!", glfwGetPrimaryMonitor(), null-pointer(<GLFWMonitor*>));
check-false("Window not null", null-pointer?(window));
glfwMakeContextCurrent(window);
/* Loop until the user closes the window */
while (~glfwWindowShouldClose(window))
/* Render here */
/* Swap front and back buffers */
glfwSwapBuffers(window);
/* Poll for and process events */
glfwPollEvents();
end;
glfwTerminate();
end test;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment