VC开发opengl应用程序时
程序代码为:
void CCooperateCADView::motion(int x, int y)
{
if(mouse_button_pressed)
{
theta -= y-mouse_y; //根据鼠标器的移动改变旋转的纬度
if(theta<0) theta = 0; //限制纬度在0到180度之间
if(theta>180) theta = 180; phi += x-mouse_x; //根据鼠标器的移动改变旋转的经度
if(phi<0) phi+=360; //限制经度在0到360度之间
if(phi>360) phi-=360; mouse_x = x; //更新记录的鼠标器位置
mouse_y = y; glutPostRedisplay();
//通知系统:窗口需要刷新
}
}
//鼠标按钮回调函数
void CCooperateCADView::mouse(int button, int state, int x, int y)
{
if(button == GLUT_LEFT_BUTTON)
    {
        if(state == GLUT_DOWN)
            //如果鼠标器左键按下,mouse_button_pressed置位
            //并记录光标位置
        {
            mouse_button_pressed = true;
            mouse_x = x;
            mouse_y = y;
        }
        else
        {
            mouse_button_pressed = false;
        }
    }
}void CCooperateCADView::OnTest() 
{
...
         glutDisplayFunc (display);
//设置窗口刷新的回调函数
glutMouseFunc(mouse);
//设置鼠标器按键回调函数
glutMotionFunc(motion);
//设置鼠标器移动回调函数
glutReshapeFunc(reshape);
//设置窗口伸缩的回调函数
glutKeyboardFunc(keyboard);
//设置键盘回调函数
}
出现:
F:\CooperateCAD\CooperateCADView.cpp(836) : error C2664: 'glutMouseFunc' : cannot convert parameter 1 from 'void (int,int,int,int)' to 'void (__cdecl *)(int,int,int,int)'
        None of the functions with this name in scope match the target type
F:\CooperateCAD\CooperateCADView.cpp(838) : error C2664: 'glutMotionFunc' : cannot convert parameter 1 from 'void (int,int)' to 'void (__cdecl *)(int,int)'
        None of the functions with this name in scope match the target type
F:\CooperateCAD\CooperateCADView.cpp(840) : error C2664: 'glutReshapeFunc' : cannot convert parameter 1 from 'void (int,int)' to 'void (__cdecl *)(int,int)'
        None of the functions with this name in scope match the target type
等错误请教各位高人,如何解决,谢谢!