本文整理汇总了C++中menu::add_option方法的典型用法代码示例。如果您正苦于以下问题:C++ menu::add_option方法的具体用法?C++ menu::add_option怎么用?C++ menu::add_option使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类menu
的用法示例。
在下文中一共展示了menu::add_option方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
glutInit(&argc,argv);
glutInitWindowPosition(0,0);
glutInitWindowSize(800,600);
glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGBA);
glutCreateWindow("PewPew");
//glEnable(GL_LIGHTING);
glEnable(GL_LINE_SMOOTH);
glEnable(GL_BLEND);
//glShadeModel(GL_SMOOTH);
//glEnable(GL_LIGHT0);
glMatrixMode(GL_PROJECTION);
open_joystick();
mn.add_option(std::string("INFO"),(&info_action));
mn.add_option(std::string("PLAY"),(&run));
mn.add_option(std::string("NEW GAME"),(&new_game));
mn.add_option(std::string("OPTIONS"),(&option_action));
mn.add_option(std::string("QUIT"),(&end_0));
menu_pages.push(&mn);
opt.add_option(std::string("BACK"),(&back));
opt.add_option(std::string("SCORES"),(&scores_action));
opt.add_option(std::string("SOUNDS ON"),(&sound_off),std::string("SOUNDS OFF"),(&sound_on));
scores.add_option(std::string("BACK"), (&back));
info.add_option(std::string("BACK"),(&back));
//GLfloat filter[11] = {0.3,0.28,0.26,0.24,0.22,0.20,0.22,0.24,0.26,0.28,0.3}; //GOOD
//glSeparableFilter2D(GL_SEPARABLE_2D, GL_LUMINANCE, 11, 11, GL_LUMINANCE, GL_FLOAT, filter,filter); //<< segfault !!!
//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
glutReshapeFunc(reshape);
glutDisplayFunc(display);
//glutIdleFunc(mytimer);
glutTimerFunc(20,mytimer,1);
glutIgnoreKeyRepeat(1);
glutKeyboardUpFunc(kbRelF);
glutSpecialFunc(skbF);
glutKeyboardFunc(kbF);
glutPassiveMotionFunc(mIdleF);
glutMouseFunc(mF);
glutMainLoop();
return 0;
}