6 #include "opengl/opengl.h"
12 static void cleanup();
13 static void display();
16 static void key_clbk(GLFWwindow *win, int key, int scancode, int action, int mods);
18 /* global variables */
24 int main(int argc, char **argv)
26 for(int i=0; i<argc; ++i) {
27 if(strcmp(argv[i], "-opengl") == 0) {
29 printf("Backend: OpenGL.\n");
31 else if(strcmp(argv[i], "-vulkan") == 0) {
33 printf("Backend: Vulkan.\n");
36 printf("No backend specified. Using OpenGL.\n");
41 fprintf(stderr, "Failed to initialize program.\n");
45 glfwSetKeyCallback(win, key_clbk);
47 while(!glfwWindowShouldClose(win)) {
82 static void key_clbk(GLFWwindow *win, int key, int scancode, int action, int mods)
84 if(key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) {
85 glfwSetWindowShouldClose(win, GLFW_TRUE);