本文整理汇总了C++中Render::getWindowHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ Render::getWindowHeight方法的具体用法?C++ Render::getWindowHeight怎么用?C++ Render::getWindowHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Render
的用法示例。
在下文中一共展示了Render::getWindowHeight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resize
void Workarea::resize()
{
Render *render = RenderSystem::getInstance().getRenderer();
int width = render->getWindowWidth(),
height = render->getWindowHeight();
m_graphics->setTargetPlane(width, height);
m_top->resize(width, height, m_width, m_height);
// m_top->setDimension(gcn::Rectangle(0, 0, width, height));
m_width = width;
m_height = height;
}
示例2: init
void Workarea::init()
{
m_imageLoader = new gcn::OpenGLSDLImageLoader();
// Set the loader that the OpenGLImageLoader should use to load images from
// disk, as it can't do it itself, and then install the image loader into
// guichan.
gcn::Image::setImageLoader(m_imageLoader);
// Create the handler for OpenGL graphics.
m_graphics = new gcn::OpenGLGraphics();
// Tell it the size of our screen.
Render * render = RenderSystem::getInstance().getRenderer();
m_width = render->getWindowWidth();
m_height = render->getWindowHeight();
m_graphics->setTargetPlane(m_width, m_height);
m_input = new gcn::SDLInput();
m_top = new RootWidget();
m_top->setDimension(gcn::Rectangle(0, 0, m_width, m_height));
m_top->setOpaque(false);
m_top->setFocusable(true);
m_top->setTabInEnabled(false);
m_gui = new Gui();
m_gui->setGraphics(m_graphics);
m_gui->setInput(m_input);
m_gui->setTop(m_top);
try {
std::string font_path = m_fixed_font;
m_system->getFileHandler()->getFilePath(font_path);
gcn::ImageFontXPM * font = new gcn::ImageFontXPM("default_font", rpgfont_xpm, m_fixed_font_characters);
gcn::Widget::setGlobalFont(font);
} catch (...) {
std::cerr << "Failed to load font " << m_fixed_font << std::endl << std::flush;
}
gcn::Window* con_w = new ConnectWindow();
m_top->add(con_w, m_width / 2 - con_w->getWidth() / 2, m_height / 2 - con_w->getHeight () / 2);
m_panel = new Panel(m_top);
// m_top->add(m_panel, 0, 0);
m_top->setWindowCoords(m_panel, std::make_pair(0,0));
m_windows["panel"] = m_panel;
m_windows["connect"] = con_w;
m_windows["login"] = new LoginWindow();
m_windows["character"] = new CharacterWindow();
m_windows["update"] = new WFUTWindow();
m_windows["compass"] = new Compass();
m_system->getActionHandler()->addHandler("connected", "/workarea_close connect");
m_system->getActionHandler()->addHandler("connected", "/workarea_open login");
m_system->getActionHandler()->addHandler("disconnected", "/workarea_alert Connection to server failed");
m_system->getActionHandler()->addHandler("disconnected", "/workarea_open connect");
m_system->getActionHandler()->addHandler("logged_in", "/workarea_close login");
m_system->getActionHandler()->addHandler("logged_in", "/workarea_open character");
m_system->getActionHandler()->addHandler("world_entered", "/workarea_close character");
m_system->getActionHandler()->addHandler("world_entered", "/workarea_open panel");
m_system->getActionHandler()->addHandler("avatar_failed", "/workarea_alert Unable to get character");
m_system->getActionHandler()->addHandler("inventory_open", "/panel_toggle Inventory");
RenderSystem::getInstance().ContextCreated.connect(sigc::mem_fun(*this, &Workarea::contextCreated));
RenderSystem::getInstance().ContextDestroyed.connect(sigc::mem_fun(*this, &Workarea::contextDestroyed));
}