source/Display/Display.cpp: Use the new display api that does not require recreating the display.
This commit is contained in:
parent
ea91d50a84
commit
74a2ff028c
1 changed files with 17 additions and 16 deletions
|
|
@ -98,28 +98,29 @@ void Display::setSize(unsigned int width, unsigned int height)
|
|||
|
||||
void Display::setVideoMode(Mode mode)
|
||||
{
|
||||
DisplayDescription desc;
|
||||
|
||||
if (m_fmode == mode) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode == FULLSCREEN || mode == WINDOWEDFULLSCREEN) {
|
||||
|
||||
// True fullscreen
|
||||
if (mode == FULLSCREEN) {
|
||||
desc.mode = m_description.mode;
|
||||
} else {
|
||||
desc.mode = DisplayMode::getDesktopMode();
|
||||
m_cacheDesc = m_description;
|
||||
}
|
||||
|
||||
desc.decoration = DisplayDecorate::None;
|
||||
} else {
|
||||
desc = m_cacheDesc;
|
||||
if (mode != FULLSCREEN) {
|
||||
m_impl->exitFullscreen();
|
||||
}
|
||||
|
||||
create(desc);
|
||||
// True fullscreen
|
||||
if (mode == FULLSCREEN) {
|
||||
m_impl->enterFullscreen(m_description.mode);
|
||||
}
|
||||
// Windowed fullscreen.
|
||||
else if (mode == WINDOWEDFULLSCREEN) {
|
||||
DisplayMode desktop = DisplayMode::getDesktopMode();
|
||||
m_impl->setDecoration(DisplayDecorate::None);
|
||||
m_impl->setSize(desktop.width, desktop.height);
|
||||
}
|
||||
// Window mode.
|
||||
else {
|
||||
// Set stored decoration.
|
||||
m_impl->setDecoration(m_description.decoration);
|
||||
}
|
||||
|
||||
m_fmode = mode;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue