void HumanClientApp::Reinitialize() { bool fullscreen = GetOptionsDB().Get<bool>("fullscreen"); bool fake_mode_change = GetOptionsDB().Get<bool>("fake-mode-change"); std::pair<int, int> size = GetWindowWidthHeight(); SetVideoMode(GG::X (size.first), GG::Y (size.second), fullscreen, fake_mode_change); HandleWindowResize (GG::X (size.first), GG::Y (size.second)); }
void HumanClientApp::Reinitialize() { bool fullscreen = GetOptionsDB().Get<bool>("fullscreen"); bool fake_mode_change = GetOptionsDB().Get<bool>("fake-mode-change"); std::pair<int, int> size = GetWindowWidthHeight(); bool fullscreen_transition = Fullscreen() != fullscreen; GG::X old_width = AppWidth(); GG::Y old_height = AppHeight(); SetVideoMode(GG::X(size.first), GG::Y(size.second), fullscreen, fake_mode_change); if (fullscreen_transition) { FullscreenSwitchSignal(fullscreen); // after video mode is changed but before DoLayout() calls } else if (fullscreen && (old_width != size.first || old_height != size.second) && GetOptionsDB().Get<bool>("UI.auto-reposition-windows")) { // Reposition windows if in fullscreen mode... handled here instead of // HandleWindowResize() because the prev. fullscreen resolution is only // available here. RepositionWindowsSignal(); } // HandleWindowResize is already called via this signal sent from // SDLGUI::HandleSystemEvents() when in windowed mode. This sends the // signal (and hence calls HandleWindowResize()) when in fullscreen mode, // making the signal more consistent... if (fullscreen) { WindowResizedSignal(GG::X(size.first), GG::Y(size.second)); } }
//----------------------------------------------------------------------------- int luaGetWindowWidthHeight(lua_State* pLuaState) { SoLuaBind::FuncBegin(); float fWidth = 0.0f; float fHeight = 0.0f; GetWindowWidthHeight(SoLuaBind::GetInt(0), fWidth, fHeight); SoLuaBind::Return(fWidth); SoLuaBind::Return(fHeight); return SoLuaBind::FuncEnd(); }