This has little to do with "Game Programming" but it's OpenGL/GLUT related and maybe this is the best forum section for such question. If not, please move it appropriately.
Normally this would be something like:
But it doesn't work. Fater looking it up on Google I couldn't find much information about this, maybe it's not possible using GLUT? I found a couple of examples like:Code:glutAddMenuEntry("-", <opid>);
orCode:glutAddMenuEntry("-", 0);
But neither worked...Code:glutAddMenuEntry("-", -1);
Full code example below:
I don't see a separator like Windows does for other items, instead I see the menu item label as a dash.Code:#include <math.h> #include <GL/glut.h> #define WINDOW_WIDTH 640 #define WINDOW_HEIGHT 480 void changeSize(int w, int h) { if(h == 0) h = 1; float ratio = 1.0 * w / h; glMatrixMode(GL_PROJECTION); glLoadIdentity(); glViewport(0, 0, w, h); gluPerspective(45.0f, ratio, 1.0f, 1000.0f); glMatrixMode(GL_MODELVIEW); } void renderScene(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); gluLookAt( 0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0f, 1.0f, 0.0f ); glutWireTeapot(1.0); glutSwapBuffers(); } void processMenuEvents(int option) { } void main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); glutInitWindowPosition( (glutGet(GLUT_SCREEN_WIDTH) - WINDOW_WIDTH) / 2, (glutGet(GLUT_SCREEN_HEIGHT) - WINDOW_HEIGHT) / 2 ); glutInitWindowSize(WINDOW_WIDTH, WINDOW_HEIGHT); glutCreateWindow("Camera Demo"); glutDisplayFunc(renderScene); glutReshapeFunc(changeSize); glutCreateMenu(processMenuEvents); glutAddMenuEntry("OPTION 1", 1); glutAddMenuEntry("-", -1); glutAddMenuEntry("OPTION 2", 2); glutAttachMenu(GLUT_RIGHT_BUTTON); glEnable(GL_DEPTH_TEST); glEnable(GL_CULL_FACE); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glutMainLoop(); }



LinkBack URL
About LinkBacks


