# HG changeset patch # User Eleni Maria Stea # Date 1384685205 -7200 # Node ID 96b022f1210e437a4697bc2ebd5c971967d26572 # Parent 8b81571dd4dda6247f347402bed39d17271999d2 'w' to switch to wireframe diff -r 8b81571dd4dd -r 96b022f1210e src/main.cc --- a/src/main.cc Sun Nov 17 00:15:04 2013 +0200 +++ b/src/main.cc Sun Nov 17 12:46:45 2013 +0200 @@ -21,14 +21,15 @@ static const char *filename = "data/textures/wallpaper.jpg"; static const char *vsdr_path = "data/shaders/invisible.v.glsl"; static const char *fsdr_path = "data/shaders/invisible.f.glsl"; +static unsigned char tex; static unsigned int sprog; static unsigned int drawing; static unsigned int debugging; -static unsigned char tex; static int tex_height; static int tex_width; static float aspect; static bool show; +static bool wireframe; static void cleanup(); static bool init(); @@ -89,6 +90,10 @@ glUseProgram(sprog); // draw video frame + + if(wireframe) + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glMatrixMode(GL_MODELVIEW); glPushMatrix(); glTranslatef(0, 0, -QUAD_DIST); @@ -112,6 +117,9 @@ glUseProgram(0); + if(wireframe) + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + if(show) glCallList(debugging); glFlush(); @@ -133,10 +141,10 @@ { switch(key) { case 's': - if(show) - show = false; - else - show = true; + show = show ? false : true; + break; + case 'w': + wireframe = wireframe ? false : true; break; case 27: exit(0);