这个是什么意思?cannot convert parameter 1 from 'void (int,int)' to 'void (__cdecl *)(int,int,int,int)'
我想写个OpenGL的键盘鼠标交互功能,但是出了点问题我不知道怎么改
void myKeyboard(char theKey)
{
switch(theKey)
{
case'1':
glPushMatrix();
glTranslated(0.5, 0.5, 0.5); //在(0.5, 0.5, 0.5)处画一个大立方体
glutWireCube(1.0);
glPopMatrix();
break;
case'2':
glPushMatrix();
glTranslated(1.0, 1.0, 0); //在(1.0, 1.0, 0)处画一个球体
glutWireSphere(0.25, 10, 8);
glPopMatrix();
break;
case'0':
exit(-1); //终止程序
default:
break; //无操作
}
}
void myMouse(int button, int state)
{
if(button == GLUT_RIGHT_BUTTON && state == GLUT_DOWN)
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
void main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize(640, 480);
glutInitWindowPosition(100, 100);
glutCreateWindow("Transformation testbed - wire frames");
glutDisplayFunc(displayWire);
glutKeyboardFunc(myKeyboard);
glutMouseFunc(myMouse);
glClearColor(1.0f, 1.0f, 1.0f, 0.0f); //背景为白色
glViewport(0, 0, 640, 480);
glutMainLoop();
}