コード例 #1
0
ファイル: GameInterface.cpp プロジェクト: jnadal/LAIG-Projeto
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);

}
コード例 #2
0
ファイル: TPinterface.cpp プロジェクト: duartepbrandao/LAIG
void TPinterface::initGUI()
{
	GLUI_Panel *lightPanel= addPanel("Lights",1);
	for(unsigned int i=0;i<((LightingScene*) scene)->lightState.size();i++){
		char name[30]="";
		std::string s = ((LightingScene*) scene)->lights[i]->getID();
		sprintf(name, "%s", s.c_str());
		addCheckboxToPanel(lightPanel,name,&(((LightingScene*) scene)->lightState[i]),0);
	}

	addColumn();

	GLUI_Panel *cameraPanel= addPanel("Cameras",1);
	if(((LightingScene*) scene)->cameras.size()<5){
		GLUI_RadioGroup *radioCameras=addRadioGroupToPanel(cameraPanel,&((LightingScene*) scene)->camera,1);
		for(unsigned int i=0;i<((LightingScene*) scene)->cameras.size();i++){
			char name[30]="";
			std::string s =((LightingScene*) scene)->cameras[i]->getID();
			sprintf(name, "%s", s.c_str());
			addRadioButtonToGroup(radioCameras,name);
		}
	}
	else{
		GLUI_Listbox *listbox = addListboxToPanel(cameraPanel,"Cameras",&((LightingScene*) scene)->camera,2);

		for(unsigned int i=0;i<2;i++){
			char name[30]="";
			std::string s =((LightingScene*) scene)->cameras[i]->getID();
			sprintf(name, "%s", s.c_str());
			listbox->add_item(i,name);
			((LightingScene*) scene)->camera= listbox->get_int_val();
		}
	}

	addColumn();

	GLUI_Panel *drawmodePanel= addPanel("Drawmode",1);
	GLUI_RadioGroup *radioDrawmode=addRadioGroupToPanel(drawmodePanel,&((LightingScene*) scene)->drawmode,3);
	addRadioButtonToGroup(radioDrawmode,"Point");
	addRadioButtonToGroup(radioDrawmode,"Line");
	addRadioButtonToGroup(radioDrawmode,"Fill");

	addColumn();

	GLUI_Panel *themesPanel= addPanel("Themes",1);
	GLUI_Listbox *themeslistbox = addListboxToPanel(themesPanel,"Themes",&((LightingScene*) scene)->app,4);
	themeslistbox->add_item(0, "classic");
	themeslistbox->add_item(1, "mario");
	themeslistbox->add_item(2, "dragon ball");
	themeslistbox->add_item(3, "angry birds");
}
コード例 #3
0
ファイル: GameInterface.cpp プロジェクト: jnadal/LAIG-Projeto
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);

}
コード例 #4
0
ファイル: TPinterface.cpp プロジェクト: wso277/cgra-project1
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");

}
コード例 #5
0
ファイル: TPinterface.cpp プロジェクト: jpdias/CGRA
void TPinterface::initGUI()
{
	// Check CGFinterface.h and GLUI documentation for the types of controls available
	//GLUI_Panel *varPanel= addPanel("Group", 1);
	//addSpinnerToPanel(varPanel, "Val 1(interface)", 2, &testVar, 1);

	// You could also pass a reference to a variable from the scene class, if public
	//addSpinnerToPanel(varPanel, "Val 2(scene)", 2, &(((LightingScene*) scene)->sceneVar), 2);
	//addColumn ();
	GLUI_Panel *varLuz= addPanel("Luzes", 2);
	addCheckboxToPanel(varLuz, "Luz 1",&((LightingScene *) scene)->state1,NULL);
	addCheckboxToPanel(varLuz, "Luz 2",&((LightingScene *) scene)->state2,NULL);
	addCheckboxToPanel(varLuz, "Luz 3",&((LightingScene *) scene)->state3,NULL);
	addCheckboxToPanel(varLuz, "Luz 4",&((LightingScene *) scene)->state4,NULL);
	addColumn ();
	GLUI_Panel *varClock= addPanel("Relogio", 3);
	addStaticText("Relógio");
	addButton ("Pause/Start",1);
	addColumn ();
	GLUI_Panel *vartext= addPanel("Texturas",4);
	GLUI_Listbox *textvar =addListboxToPanel(vartext,"Texturas",&((LightingScene *) scene)->statetext,NULL);
	textvar->add_item (1, "Default");
	textvar->add_item (2, "Sky");
	textvar->add_item (3, "Space");
	textvar->set_int_val (3); 
	addColumn();
	GLUI_Panel *varwire= addPanel("Wireframe",5);
	GLUI_RadioGroup *group=addRadioGroupToPanel(varwire,&((LightingScene *) scene)->wire);
	addRadioButtonToGroup(group,"Normal");
	addRadioButtonToGroup(group,"Wireframe");
	addColumn();
}