Implement "q" for quit program
This commit is contained in:
parent
f7fc2cb91b
commit
36a6e2aae4
14
gl_draw.c
14
gl_draw.c
@ -393,5 +393,19 @@ void keyboard(unsigned char key, int x, int y)
|
|||||||
glTranslatef(0.0f, 0.0f, -1.0f);
|
glTranslatef(0.0f, 0.0f, -1.0f);
|
||||||
break;
|
break;
|
||||||
case 'q':
|
case 'q':
|
||||||
|
gl_destroy();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroy the gl session/window.
|
||||||
|
*/
|
||||||
|
static void gl_destroy(void)
|
||||||
|
{
|
||||||
|
free(obj->edges);
|
||||||
|
free(obj->vertices);
|
||||||
|
free(obj->faces);
|
||||||
|
free(obj);
|
||||||
|
glutDestroyWindow(glutGetWindow());
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user