コード例 #1
0
void BaseApp::InitGUI()
{
	m_pGui = new Gui(m_pFont);

	CheckBox::LoadTextures("data\\textures\\checkbox.bmp", "data\\textures\\checkbox_mark.bmp");

	CheckBox *checkBox;
	checkBox = new CheckBox(false, "Wireframe", m_pGui);
	checkBox->AddCallBack(twfCallback);
	m_pGui->AddWidget(checkBox);

	CheckBox *checkBox2;
	checkBox2 = new CheckBox(false, "Render Quadtree Bounding Boxes", m_pGui);
	checkBox2->AddCallBack(QuadtreeBoundingBoxesCallback);
	m_pGui->AddWidget(checkBox2);

	CheckBox *checkBox3;
	checkBox3 = new CheckBox(true, "Usar Vertex Buffer Objects", m_pGui);
	checkBox3->AddCallBack(UseVBOSCallback);
	m_pGui->AddWidget(checkBox3);

	CheckBox *checkBox4;
	checkBox4 = new CheckBox(true, "Usar Geomipmaps", m_pGui);
	checkBox4->AddCallBack(UseGeoMorphingCallback);
	m_pGui->AddWidget(checkBox4);

	CheckBox *checkBox5;
	checkBox5 = new CheckBox(false, "Freeze visibility culling", m_pGui);
	checkBox5->AddCallBack(FreezeVisibCallback);
	m_pGui->AddWidget(checkBox5);



	Slider::LoadTextures("data\\textures\\slider.bmp", "data\\textures\\slider_btn.bmp");

	Slider *slider;
	slider = new Slider(m_pGui, 200, 0.1f, 180.0f, 50.0f, "FOV");
	slider->AddCallBack(fovCallback);
	m_pGui->AddWidget(slider);
/*
	Slider *slider2;
	slider2 = new Slider(m_pGui, 200, 0.0f, 20.0f, 0.2f, "Wind speed");
	slider2->AddCallBack(WindSpeedCallback);
	m_pGui->AddWidget(slider2);

	Slider *slider3;
	slider3 = new Slider(m_pGui, 200, 0.0f, 100.0f, 1.0f, "Wind strength");
	slider3->AddCallBack(WindStrengthCallback);
	m_pGui->AddWidget(slider3);
*/
	Slider *slider4;
	slider4 = new Slider(m_pGui, 200, 0.0f, 0.1f, 0.005f, "Blur offset");
	slider4->AddCallBack(BlurOffsetCallback);
	m_pGui->AddWidget(slider4);
}