quick backup
[demo] / src / opengl / opengl.cc
index 844b3ac..66dd002 100644 (file)
@@ -1,4 +1,5 @@
 #include <GL/glew.h>
+#include <GLFW/glfw3.h>
 #include <stdio.h>
 
 #include "gfxapi.h"
@@ -12,6 +13,8 @@ static void clear(float r, float g, float b);
 static void viewport(int x, int y, int width, int height);
 static void zbuffer(bool enable);
 static void cull_face(Gfx_cull_face cf);
+static void reshape(int width, int height) {}
+static void wireframe(bool enable);
 
 bool init_opengl()
 {
@@ -40,6 +43,8 @@ bool init_opengl()
        gfx_viewport = viewport;
        gfx_zbuffer = zbuffer;
        gfx_cull_face = cull_face;
+       gfx_reshape = reshape;
+       gfx_wireframe = wireframe;
 
        // glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
        return true;
@@ -87,4 +92,12 @@ static void cull_face(Gfx_cull_face cf)
                glCullFace(GL_BACK);
                break;
        }
-}
\ No newline at end of file
+}
+
+static void wireframe(bool enabled)
+{
+       if(enabled)
+               glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+       else
+               glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+}