//---------------------------------------------------------------------------- bool NURBSCurveExample::OnKeyDown (unsigned char key, int x, int y) { if (WindowApplication2::OnKeyDown(key, x, y)) { return true; } switch (key) { case 'g': if (mSimTime <= 1.0f) { DoSimulation1(); } else if (mSimTime <= 2.0f) { DoSimulation2(); } else { InitialConfiguration(); } return true; case '0': InitialConfiguration(); OnDisplay(); return true; case 'c': mDrawControlPoints = !mDrawControlPoints; OnDisplay(); return true; } return false; }
//---------------------------------------------------------------------------- void NURBSCurveExample::OnKeyDown (unsigned char ucKey, int, int) { if ( ucKey == 'q' || ucKey == 'Q' || ucKey == KEY_ESCAPE ) { RequestTermination(); return; } switch ( ucKey ) { case 'g': if ( m_fSimTime <= 1.0f ) DoSimulation1(); else if ( m_fSimTime <= 2.0f ) DoSimulation2(); else InitialConfiguration(); break; case '0': InitialConfiguration(); OnDisplay(); break; case 'c': m_bDrawControlPoints = !m_bDrawControlPoints; OnDisplay(); break; } }