glutAddMenuEntry("R/G/B/All Light 2", LIGHT_RGBALL_LIGHT_2);\r
\r
// Construct add object submenus\r
- int addObjectSubmenu[6];\r
int objectMenuEntriesSize = sizeof(objectMenuEntries) / sizeof(objectMenuEntries[0]);\r
int menuNumber = objectMenuEntriesSize / 10 + 1;\r
+ int addObjectSubmenu[menuNumber-1];\r
\r
for( int i = 0; i < menuNumber; i++ ) {\r
addObjectSubmenu[i] = glutCreateMenu(processObjectEvents);\r
\r
// Construct add object menu\r
int addObjectMenu = glutCreateMenu(processObjectEvents);\r
- glutAddSubMenu( "test", addObjectSubmenu[0] );\r
- /*for ( int i = 0; addObjectSubmenu[i]; i++ ) {\r
- glutAddSubMenu( (char)i, addObjectSubmenu[i] );\r
- }*/\r
+ for ( int i = 0; addObjectSubmenu[i]; i++ ) {\r
+ char name[10]; // buffer to hold name\r
+ sprintf(name, "%d-%d", i+1, i+10);\r
+ glutAddSubMenu( name, addObjectSubmenu[i] );\r
+ }\r
\r
\r
int mainMenu = glutCreateMenu(processMainEvents);\r