#include <GL/glew.h>
+#include <GLFW/glfw3.h>
#include <stdio.h>
#include <stdlib.h>
{
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");
return 1;
}
+ //TODO
+ //return 0;
+
glfwSetKeyCallback(win, clbk_key);
glfwSetCursorPosCallback(win, clbk_motion);
glfwSetMouseButtonCallback(win, clbk_mouse);
}
cleanup();
- // atexit(cleanup);
return 0;
}
break;
// case 'F':
- // fog_density = fog_density < 1 - 0.0009 ? fog_density + 0.0001 : 1;
- // break;
+ // fog_density = fog_density < 1 - 0.0009 ? fog_density + 0.0001 : 1;
+ // break;
// case 'U':
- // fog_density = fog_density > 0.0001 ? fog_density - 0.0001 : 0;
- // break;
+ // fog_density = fog_density > 0.0001 ? fog_density - 0.0001 : 0;
+ // break;
+
+ case 'P':
+ gfx_wireframe(true);
+ break;
+
+ case 'F':
+ gfx_wireframe(false);
+ break;
default:
break;
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);
}
}
return false;
-}
\ No newline at end of file
+}