X-Git-Url: https://eleni.mutantstargoat.com/git/?p=demo;a=blobdiff_plain;f=src%2Fopengl%2Fopengl.cc;h=66dd002e5a4c2c04c3bb4730ccf654b1d40dfeb7;hp=f6a7ceff2b37db30be07f4c971e421a448e373ef;hb=72995482b98ff2a014ddd737131a0935ead89977;hpb=9148ff7614b1dc22fd5d1dcf6d74e2fb4ff13706 diff --git a/src/opengl/opengl.cc b/src/opengl/opengl.cc index f6a7cef..66dd002 100644 --- a/src/opengl/opengl.cc +++ b/src/opengl/opengl.cc @@ -13,7 +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 reshape(int width, int height) {} +static void wireframe(bool enable); bool init_opengl() { @@ -43,6 +44,7 @@ bool init_opengl() gfx_zbuffer = zbuffer; gfx_cull_face = cull_face; gfx_reshape = reshape; + gfx_wireframe = wireframe; // glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); return true; @@ -91,3 +93,11 @@ static void cull_face(Gfx_cull_face cf) break; } } + +static void wireframe(bool enabled) +{ + if(enabled) + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + else + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); +}