X-Git-Url: http://git.mutantstargoat.com?a=blobdiff_plain;f=src%2Fopengl%2Fopengl.cc;h=00b42f5b40c88bdd7bf1b243bd00a6a0aed6b388;hb=f6ceb163227d00d7f97df1fc2dfbdd419c56277e;hp=9b220aba8b8a371c5ac4ecfd2f80f2890d3402f6;hpb=0c5fa3525b2c8151bf83a215eee992c257d6fa28;p=demo diff --git a/src/opengl/opengl.cc b/src/opengl/opengl.cc index 9b220ab..00b42f5 100644 --- a/src/opengl/opengl.cc +++ b/src/opengl/opengl.cc @@ -13,6 +13,11 @@ 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); +static void swapbuffers(); +static void begin_drawing(); +static void end_drawing(); bool init_opengl() { @@ -41,6 +46,11 @@ bool init_opengl() gfx_viewport = viewport; gfx_zbuffer = zbuffer; gfx_cull_face = cull_face; + gfx_reshape = reshape; + gfx_wireframe = wireframe; + gfx_swapbuffers = swapbuffers; + gfx_begin_drawing = begin_drawing; + gfx_end_drawing = end_drawing; // glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); return true; @@ -88,4 +98,25 @@ 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); +} + +static void swapbuffers() +{ + glfwSwapBuffers(win); +} + +static void begin_drawing() +{ +} + +static void end_drawing() +{ +}