void GameInterface::initGUI() { int* option= &((XMLScene*) scene)->option; GLUI_Panel* viewPanel= addPanel("View Points",1); viewPanel->set_alignment(1); GLUI_RadioGroup* group = addRadioGroupToPanel(viewPanel,&((XMLScene*) scene)->viewPoint,16); addRadioButtonToGroup(group,"Lateral"); addRadioButtonToGroup(group,"Upper"); GLUI_Panel *gameModePanel = addPanel("Game", 1); gameModePanel->set_alignment(0); GLUI_Listbox* themeListBox =addListboxToPanel(gameModePanel,"Theme: ",option,8); themeListBox->add_item (0, "Classic"); themeListBox->add_item (1, "Minecraft"); themeListBox->add_item (2, "Dragon Ball"); GLUI_Button* undo = addButtonToPanel(gameModePanel,"Undo",12); addColumnToPanel(gameModePanel); GLUI_Listbox* gameModeListbox=addListboxToPanel(gameModePanel,"Game Mode", &((XMLScene*) scene)->data->newGameMode,9); gameModeListbox->add_item(1,"PVP"); gameModeListbox->add_item(2,"Player vs PC"); gameModeListbox->add_item(3,"PC vs PC"); GLUI_Button* redo = addButtonToPanel(gameModePanel,"Redo",13); addColumnToPanel(gameModePanel); GLUI_Panel* difficultiesPanel=addPanelToPanel(gameModePanel,"Difficulties",1); difficultiesPanel->set_alignment(0); GLUI_Listbox* difficulty1Listbox=addListboxToPanel(difficultiesPanel,"Computer 1", &((XMLScene*) scene)->data->newDifficulties[0],10); difficulty1Listbox->add_item(1,"Normal"); difficulty1Listbox->add_item(2,"Hard"); GLUI_Button* restart = addButtonToPanel(gameModePanel,"Restart",14); GLUI_Listbox* difficulty2Listbox=addListboxToPanel(difficultiesPanel,"Computer 2", &((XMLScene*) scene)->data->newDifficulties[1],11); difficulty2Listbox->add_item(1,"Normal"); difficulty2Listbox->add_item(2,"Hard"); GLUI_Button* gameMovie = addButtonToPanel(gameModePanel,"Game Movie",15); }
void GameInterface::initGUI() { int* option= &((XMLScene*) scene)->option; /* GLUI_Panel *varPanel1 = addPanel("Cameras", 1); int* camera = &((XMLScene*) scene)->camera; GLUI_Listbox *texturesListbox =addListboxToPanel(varPanel1,"Camera: ",camera,7); unsigned int size=((XMLScene*) scene)->file->sceneCameras.size(); for(unsigned int i = 0;i<size;i++) { texturesListbox->add_item (i, ((XMLScene*) scene)->file->sceneCameras[i].first); } //addColumn(); GLUI_Panel *varPanel2 = addPanel("Draw Mode", 1); varPanel2->set_alignment(0); GLUI_RadioGroup* radioGroup = addRadioGroupToPanel(varPanel2,&((XMLScene*) scene)->drawmode,3); addRadioButtonToGroup(radioGroup,"Fill"); addRadioButtonToGroup(radioGroup,"Line"); addRadioButtonToGroup(radioGroup,"Point"); addColumn(); */ GLUI_Panel *gameModePanel = addPanel("Game", 1); gameModePanel->set_alignment(0); GLUI_Listbox* themeListBox =addListboxToPanel(gameModePanel,"Theme: ",option,8); themeListBox->add_item (0, "Classic"); themeListBox->add_item (1, "Minecraft"); GLUI_Button* undo = addButtonToPanel(gameModePanel,"Undo",12); addColumnToPanel(gameModePanel); GLUI_Listbox* gameModeListbox=addListboxToPanel(gameModePanel,"Game Mode", &((XMLScene*) scene)->data->gameMode,9); gameModeListbox->add_item(1,"PVP"); gameModeListbox->add_item(2,"Player vs PC"); gameModeListbox->add_item(3,"PC vs PC"); GLUI_Button* redo = addButtonToPanel(gameModePanel,"Redo",13); addColumnToPanel(gameModePanel); GLUI_Panel* difficultiesPanel=addPanelToPanel(gameModePanel,"Difficulties",1);; difficultiesPanel->set_alignment(0); GLUI_Listbox* difficulty1Listbox=addListboxToPanel(difficultiesPanel,"Computer 1", &((XMLScene*) scene)->data->difficulties[0],10); difficulty1Listbox->add_item(1,"Normal"); difficulty1Listbox->add_item(2,"Hard"); GLUI_Button* restart = addButtonToPanel(gameModePanel,"Restart",14); GLUI_Listbox* difficulty2Listbox=addListboxToPanel(difficultiesPanel,"Computer 2", &((XMLScene*) scene)->data->difficulties[1],11); difficulty2Listbox->add_item(1,"Normal"); difficulty2Listbox->add_item(2,"Hard"); GLUI_Button* gameFilm = addButtonToPanel(gameModePanel,"Game Film",15); }
void TPinterface::initGUI() { // Check CGFinterface.h and GLUI documentation for the types of controls available GLUI_Panel *varPanel = addPanel("Lights", 1); // You could also pass a reference to a variable from the scene class, if public addCheckboxToPanel(varPanel, "light0", &on0, 0); addCheckboxToPanel(varPanel, "light1", &on1, 1); addCheckboxToPanel(varPanel, "light2", &on2, 2); addCheckboxToPanel(varPanel, "light3", &on3, 3); addCheckboxToPanel(varPanel, "light4", &on4, 4); addButtonToPanel(varPanel, "Clock", 5); GLUI_RadioGroup* wireframeGroup = addRadioGroupToPanel(varPanel,&radioStatus, 6); addRadioButtonToGroup(wireframeGroup, "Textured"); addRadioButtonToGroup(wireframeGroup, "Wireframed"); GLUI_Listbox* listBox = addListboxToPanel(varPanel,"Textures",&listStatus, 7); listBox->add_item(0, "Default"); listBox->add_item(1, "Earth"); }
void GraphSceneUI::initAnimationsPanel() { char* text = new char[256]; strcpy(text, "Animations"); GLUI_Panel* animationsPanel = addPanel(text); strcpy(text, "Restart"); addButtonToPanel(animationsPanel, text, ANIMATIONS_RESET_BUTTON); }
void TPinterface::initGUI() { GLUI_Panel *lights= addPanel("Luzes", 1); addCheckboxToPanel(lights,"Light0", NULL,100)->set_int_val(1); addCheckboxToPanel(lights,"Light1", NULL,101)->set_int_val(1); addCheckboxToPanel(lights,"Light2", NULL,102)->set_int_val(1); addCheckboxToPanel(lights,"Light3", NULL,103)->set_int_val(1); GLUI_Panel *clock= addPanel("Clock", 1); clockbt=addButtonToPanel(clock,"Stop",104); }
void DemoInterface::initGUI() { // Check CGFinterface.h and GLUI documentation for the types of controls available GLUI_Panel *varPanel= addPanel("Teapot Shader", 1); addSpinnerToPanel(varPanel, "normScale", 2,NULL, 1); addColumn(); varPanel= addPanel("Display List", 1); addCheckboxToPanel(varPanel, "Use", &(((DemoScene*) scene)->myDLObj->usingDL), 2); addColumn(); varPanel= addPanel("Animations", 1); addButtonToPanel(varPanel, "Reset", 3); addColumn(); addCheckbox( "Wireframe", &(((DemoScene*) scene)->wireframe), 4); }
void Interface::initGUI() { GLUI_Panel *geral =addPanel("Opcoes", 1); addColumnToPanel(geral); GLUI_Panel *luzesPanel = addPanelToPanel(geral,"Luzes", 1); for(unsigned int i=0;i<((ANFScene *) scene)->parser.lights.size();i++){ string str=((ANFScene *) scene)->parser.lights[i]->id; char * writable = new char[str.size() + 1]; copy(str.begin(), str.end(), writable); writable[str.size()] = '\0'; if(((ANFScene *) scene)->parser.lights[i]->enabled==true){ addCheckboxToPanel(luzesPanel,writable,NULL,i)->set_int_val(1); } else{ addCheckboxToPanel(luzesPanel,writable,NULL,i)->set_int_val(0); } delete[] writable; } addColumnToPanel(geral); GLUI_Panel *camerasPanel = addPanelToPanel(geral,"Camaras", 1); GLUI_RadioGroup *cameraList = addRadioGroupToPanel(camerasPanel,&(((ANFScene *) scene)->parser.activeCam)); for(unsigned int i=0;i<((ANFScene *) scene)->parser.cameras.size();i++){ string str=((ANFScene *) scene)->parser.cameras[i]->id; char * writable = new char[str.size() + 1]; copy(str.begin(), str.end(), writable); writable[str.size()] = '\0'; if(i == ((ANFScene *) scene)->parser.activeCam) addRadioButtonToGroup(cameraList, writable)->set_int_val(1); else addRadioButtonToGroup(cameraList, writable); delete[] writable; } addRadioButtonToGroup(cameraList, "Default"); addColumnToPanel(geral); GLUI_Panel *drawPanel = addPanelToPanel(geral,"Draw Mode", 1); GLUI_RadioGroup *drawList = addRadioGroupToPanel(drawPanel,&(((ANFScene *) scene)->parser.globals->drawing.mode)); addRadioButtonToGroup(drawList, "Fill"); addRadioButtonToGroup(drawList, "Line"); addRadioButtonToGroup(drawList, "Point"); addColumnToPanel(geral); GLUI_Panel *windPanel = addPanelToPanel(geral,"Wind Value", 1); GLUI_Spinner *spinner = addSpinnerToPanel(windPanel, "windScale",GLUI_SPINNER_INT,&(((ANFScene *) scene)->parser.wind),9); spinner->set_speed(0.5); spinner->set_int_limits(0,10,GLUI_LIMIT_WRAP); GLUI_Panel *varPanel= addPanelToPanel(geral,"Animations", 1); addButtonToPanel(varPanel, "Reset", 8); }
void DemoInterface::initGUI() { this->pieceSelected=false; scorep1=0; scorep2=0; glutReshapeWindow(680,550); GLUI_Panel *masterPanel=addPanel("Interface",GLUI_PANEL_RAISED); addStaticTextToPanel(masterPanel,"Interface"); int atual=2; GLUI_Panel *globalPanel= addPanelToPanel(masterPanel,"Globals", 1); GLUI_RadioGroup * g1 = addRadioGroupToPanel(globalPanel,&(((DemoScene *) scene)->drawMode),1); addRadioButtonToGroup(g1,"Fill"); addRadioButtonToGroup(g1,"Wireframe"); addRadioButtonToGroup(g1,"Point"); addColumnToPanel(masterPanel); addStaticTextToPanel(masterPanel,""); GLUI_Panel *cameraPanel= addPanelToPanel(masterPanel,"Cameras",1); GLUI_RadioGroup * g2 = addRadioGroupToPanel(cameraPanel,&(((DemoScene*) scene)->activeCameraNumber),atual); atual++; map<string,Camera *>::const_iterator it; for(it=((DemoScene*) scene)->cameras.begin();it!=((DemoScene*) scene)->cameras.end();it++){ addRadioButtonToGroup(g2,(char*)it->second->id.c_str()); } addColumnToPanel(masterPanel); addStaticTextToPanel(masterPanel,""); GLUI_Panel *lighPanel=addPanelToPanel(masterPanel,"Lights",1); for(unsigned int i=0;i<((DemoScene *) scene)->graphLights.size();i++){ addCheckboxToPanel(lighPanel,(char*)((DemoScene *) scene)->graphLights.at(i)->id.c_str(),(int *)&((DemoScene *) scene)->graphLights.at(i)->state,atual); } atual++; atual++; addColumnToPanel(masterPanel); GLUI_Panel * ambientPanel=addPanelToPanel(masterPanel,"Game Ambient",1); GLUI_RadioGroup * amb=addRadioGroupToPanel(ambientPanel,&((DemoScene *) scene)->theme,atual); atual++; addRadioButtonToGroup(amb,"Wood"); addRadioButtonToGroup(amb,"Mineral"); addRadioButtonToGroup(amb,"Aquatic"); GLUI_Panel * gameTimePanel = addPanel("Game Time",GLUI_PANEL_EMBOSSED); GLUI_Panel * timePanel = addPanelToPanel(gameTimePanel,"Game Time",1); GLUI_EditText * time = addEditTextToPanel(timePanel,"Current Game Time", &((DemoScene *) scene)->gameTime,1); GLUI_Panel * gamePanel = addPanel("Game Status",GLUI_PANEL_EMBOSSED); GLUI_Panel * statusPanel = addPanelToPanel(gamePanel,"Game Status",1); gameStatus = addStaticTextToPanel(statusPanel,"Game Status"); char c[128]; sprintf(c, "Current player: %d | Game score: %d - %d \n ", &((DemoScene *) scene)->player,scorep1,scorep2); gameStatus->set_text(c); addColumnToPanel(gamePanel); GLUI_Panel * difPanel = addPanelToPanel(gamePanel,"Game Difficulty",1); GLUI_RadioGroup * dif=addRadioGroupToPanel(difPanel,0,atual); atual++; addRadioButtonToGroup(dif,"Easy"); addRadioButtonToGroup(dif,"Medium"); addRadioButtonToGroup(dif,"Hard"); addColumnToPanel(gamePanel); GLUI_Panel * modePanel = addPanelToPanel(gamePanel,"Game Mode",1); GLUI_RadioGroup * mode=addRadioGroupToPanel(modePanel,&((DemoScene *) scene)->gameMode,atual); atual++, addRadioButtonToGroup(mode,"Hum vs. Hum"); addRadioButtonToGroup(mode,"Hum vs. CPU"); addRadioButtonToGroup(mode,"CPU vs. CPU"); addColumnToPanel(gamePanel); GLUI_Panel * buttonPanel = addPanelToPanel(gamePanel,""); GLUI_Button * undoButton=addButtonToPanel(buttonPanel,"Undo Move",atual); atual++; GLUI_Button * replayButton=addButtonToPanel(buttonPanel,"Replay last game",atual); atual++; GLUI_Button * startButton=addButtonToPanel(buttonPanel,"Start Game",atual); atual++; }