added a vulkan util (vkutil.h/.cc)
[demo] / src / main.cc
index 69721c1..4e2c72f 100644 (file)
@@ -1,4 +1,5 @@
 #include <GL/glew.h>
+#include <GLFW/glfw3.h>
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -80,7 +81,7 @@ int main(int argc, char **argv)
 {
        Gfx_API api;
 
-       for(int i=0; i<argc; ++i) {
+       for(int i=1; i<argc; i++) {
                if(strcmp(argv[i], "-opengl") == 0) {
                        api = GFX_GL;
                        printf("Backend: OpenGL.\n");
@@ -100,6 +101,9 @@ int main(int argc, char **argv)
                return 1;
        }
 
+       //TODO
+       //return 0;
+
        glfwSetKeyCallback(win, clbk_key);
        glfwSetCursorPosCallback(win, clbk_motion);
        glfwSetMouseButtonCallback(win, clbk_mouse);
@@ -116,7 +120,6 @@ int main(int argc, char **argv)
        }
 
        cleanup();
-       // atexit(cleanup);
        return 0;
 }
 
@@ -315,6 +318,7 @@ static void clbk_mouse(GLFWwindow *win, int bn, int action, int mods)
 
 static void clbk_reshape(GLFWwindow *win, int width, int height)
 {
+       gfx_reshape(width, height);
        gfx_viewport(0, 0, width, height);
        aspect = (float)width / (float)height;
        mprojection = calc_projection_matrix(45, aspect, 0.5, 1000.0);
@@ -385,4 +389,4 @@ static bool gen_poisson(std::vector<Vec2> &points, float min_dist, float radius)
                }
        }
        return false;
-}
\ No newline at end of file
+}