#include #include #include "draw.h" #include "die.h" void resize_handler(GLFWwindow* window, int width, int height) { glViewport(0, 0, width, height); } int main(int argc, char** argv) { glfwInit(); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); int width = 800, height = 600; GLFWwindow* window = glfwCreateWindow(width, height, "vis", NULL, NULL); if (window == NULL) { glfwTerminate(); die("error: could not create window\n"); } glfwMakeContextCurrent(window); glfwSetFramebufferSizeCallback(window, resize_handler); resize_handler(window, width, height); while (!glfwWindowShouldClose(window)) { draw(window); glfwSwapBuffers(window); glfwPollEvents(); } glfwTerminate(); return EXIT_SUCCESS; }