问题描述
- openGL glutinit()右键弹出菜单
-
void createGLUTMenus() {
int menu;//glutInit(&argc,argv); // 创建菜单并告诉GLUT,processMenuEvents处理菜单事件。 menu = glutCreateMenu(processMenuEvents); glutAddMenuEntry("addObstacle",OBSTACLE); glutAddMenuEntry("addSmoke",DOUBLE); glutAddMenuEntry("changeToDragon",CHADRA); glutAddMenuEntry("changeToBunny",CHABUN); // 把菜单和鼠标右键关联起来。 glutAttachMenu(GLUT_RIGHT_BUTTON);
}
然后我在int WINAPI WinMain(HINSTANCE hCurrentInst, HINSTANCE hPreviousInst,LPSTR lpszCmdLine, int nCmdShow){}里面生成个窗口,调用 createGLUTMenus()这个函数,运行后,单击右键没出来弹出菜单呢?
时间: 2024-10-03 06:07:54