bool GraphicsSystem::CreateWindow() { DuskBenchStart(); CreateSFMLWindow(); mp_GraphicsContext.reset(New GraphicsContext(m_SfWindow)); Program::Inst()->AddEventListener(Program::EvtUpdate, this, &GraphicsSystem::OnUpdate); DuskBenchEnd("GraphicsSystem::CreateWindow"); return true; }
Screen::Screen(SORE_Graphics::ScreenInfo& _screen, const std::string& windowTitle_, const std::string& iconFilename, SORE_Utility::SettingsManager* _sm) : windowTitle(windowTitle_), screen(_screen), sm(_sm) { ENGINE_LOG(SORE_Logging::LVL_INFO, "Creating screen"); if(sm!=NULL) { screen.width = sm->WatchVariable ("screen", "width", boost::bind(std::mem_fun(&Screen::ChangeScreenOnSettingsChange), this)); screen.height = sm->WatchVariable ("screen", "height", boost::bind(std::mem_fun(&Screen::ChangeScreenOnSettingsChange), this)); screen.fullscreen = sm->WatchVariable ("screen", "fullscreen", boost::bind(std::mem_fun(&Screen::ChangeScreenOnSettingsChange), this)); screen.resizable = sm->WatchVariable ("screen", "resizable", boost::bind(std::mem_fun(&Screen::ChangeScreenOnSettingsChange), this)); screen.showCursor = sm->WatchVariable ("screen", "showcursor", boost::bind(std::mem_fun(&Screen::ChangeScreenOnSettingsChange), this)); screen.useNativeResolution = sm->WatchVariable ("screen", "native", boost::bind(std::mem_fun(&Screen::ChangeScreenOnSettingsChange), this)); } CreateSFMLWindow(); if(InitializeGL()!=0) { ENGINE_LOG(SORE_Logging::LVL_CRITICAL, "Could not initialize GL"); quitFlag = true; } }
void GraphicsSystem::ApplyWindowChanges() { CreateSFMLWindow(); Dispatch(Event(EvtWindowResize, WindowResizeEventData(m_Width, m_Height))); }
void Screen::ChangeScreen(SORE_Graphics::ScreenInfo& _screen) { screen = _screen; CreateSFMLWindow(); }