帮忙看下这个程序(十万火急)
void keyboard(unsigned char Key, int x, int y){
switch(Key)
{
case 27:
case 'q':
if(m_MButtonDown)
{
m_xShear -= (m_MDownPos.x - (float)x)/2.0f;
m_yShear -= (m_MDownPos.y - (float)y)/2.0f;
M_xShear[4]=m_xShear/100;
M_yShear[1]=m_yShear/100;
m_LDownPos.x = x;
m_LDownPos.y = y;
}
case 28:
case "w":
if(m_MButtonDown)
{
m_transZ -= (m_MDownPos.y - (float)y)/10.0f;
M_Scale[0]=M_Scale[5]=M_Scale[10]=m_transZ/150.0f+1.0f;
m_MDownPos.x = x;
m_MDownPos.y = y;
}
glutPostRedisplay();
}
}
程序的作用是按下Q键的同时通过按下鼠标中键来对图形进行拉伸,按下w键的同时按下鼠标中键对图形进行缩放,运行出现错误!
error C2051: case expression not constant!!!
谁能帮我改正下?还有键盘的输入是怎么回事?27和q什么关系?谢谢了!