本文整理汇总了C++中cegui::FrameWindow::setMaxSize方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameWindow::setMaxSize方法的具体用法?C++ FrameWindow::setMaxSize怎么用?C++ FrameWindow::setMaxSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::FrameWindow
的用法示例。
在下文中一共展示了FrameWindow::setMaxSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
void run()
{
quit = false;
CL_DisplayWindowDescription window_desc;
window_desc.set_size(CL_Size(sizex, sizey), true);
window_desc.set_title("Chess");
window_desc.set_allow_resize(true);
CL_DisplayWindow window(window_desc);
CL_Slot slot_quit = window.sig_window_close().connect(this, &SpritesExample::on_window_close);
window.func_window_resize().set(this, &SpritesExample::resize);
CL_GraphicContext gc = window.get_gc();
CL_InputDevice keyboard = window.get_ic().get_keyboard();
CL_ResourceManager resources("resources.xml");
CL_Image lol(gc,"Board",&resources);
CEGUI::OpenGLRenderer & myRenderer = CEGUI::OpenGLRenderer::bootstrapSystem();
CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();
CEGUI::DefaultWindow* root = (CEGUI::DefaultWindow*)winMgr.createWindow("DefaultWindow", "Root");
CEGUI::SchemeManager::getSingleton().create("TaharezLook.scheme");
CEGUI::System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
CEGUI::FrameWindow* wnd = (CEGUI::FrameWindow*)winMgr.createWindow("TaharezLook/FrameWindow", "Demo Window");
root->addChildWindow(wnd);
wnd->setPosition(CEGUI::UVector2(cegui_reldim(0.25f), cegui_reldim( 0.25f)));
wnd->setSize(CEGUI::UVector2(cegui_reldim(0.5f), cegui_reldim( 0.5f)));
// now we set the maximum and minum sizes for the new window. These are
// specified using relative co-ordinates, but the important thing to note
// is that these settings are aways relative to the display rather than the
// parent window.
//
// here we set a maximum size for the FrameWindow which is equal to the size
// of the display, and a minimum size of one tenth of the display.
wnd->setMaxSize(CEGUI::UVector2(cegui_reldim(1.0f), cegui_reldim( 1.0f)));
wnd->setMinSize(CEGUI::UVector2(cegui_reldim(0.1f), cegui_reldim( 0.1f)));
// As a final step in the initialisation of our sample window, we set the window's
// text to "Hello World!", so that this text will appear as the caption in the
// FrameWindow's titlebar.
wnd->setText("Hello World!");
CEGUI::System::getSingleton().renderGUI();
window.flip();
while (!quit)
{
if(keyboard.get_keycode(CL_KEY_ESCAPE) == true)
quit = true;
CL_Colorf red(155/255.0f, 60/255.0f, 68/255.0f);
//CL_Draw::fill(gc, CL_Rectf(0, sizey, sizex, 0), red);
//lol.draw(gc,CL_Rectf(0,sizey,sizex,0));
//CEGUI::System::getSingleton().renderGUI();
//window.flip();
CL_KeepAlive::process();
CL_System::sleep(10);
}
}