private static void keyboard(byte key, int x, int y)
{
//static int animating = 0,
// wireframe = 0;
switch (key)
{
case (byte)' ':
animating = !animating; /* Toggle */
if (animating)
{
Glut.glutIdleFunc(idleDelegate);
}
else
{
Glut.glutIdleFunc(null);
}
break;
case 27: /* Esc key */
/* Demonstrate proper deallocation of Cg runtime data structures.
Not strictly necessary if we are simply going to exit. */
Cg.cgDestroyProgram(myCgVertexProgram);
Cg.cgDestroyContext(myCgContext);
Environment.Exit(0);
break;
}
}