Hi,
Trying to toggle wireframe and flat shaded modes using glPolygonMode()
As per various online tutes/guides, I have this so far but all I get is seg. faults;
Thanks in advance.
Full code here --> http://pastebin.com/fSPvf1dQ
…
static GLenum fillMode = GL_FILL ;
...
void OnKeyboard( unsigned char key, int x, int y ) {
switch( key ) {
case 'w' : /* Toggle wire-frame/flat-shade. */
fillMode = !fillMode ;
glPolygonMode (GL_FRONT_AND_BACK, fillMode ? GL_FILL : GL_LINE) ;
break ;
...
}
...
}
...
int main( int argc, char** argv ) {
...
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ) ;
...
glutKeyboardFunc( OnKeyboard ) ;
...
}