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)
|
void Display::setVideoMode(Mode mode)
|
||||||
{
|
{
|
||||||
DisplayDescription desc;
|
|
||||||
|
|
||||||
if (m_fmode == mode) {
|
if (m_fmode == mode) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode == FULLSCREEN || mode == WINDOWEDFULLSCREEN) {
|
if (mode != FULLSCREEN) {
|
||||||
|
m_impl->exitFullscreen();
|
||||||
|
}
|
||||||
|
|
||||||
// True fullscreen
|
// True fullscreen
|
||||||
if (mode == FULLSCREEN) {
|
if (mode == FULLSCREEN) {
|
||||||
desc.mode = m_description.mode;
|
m_impl->enterFullscreen(m_description.mode);
|
||||||
} else {
|
|
||||||
desc.mode = DisplayMode::getDesktopMode();
|
|
||||||
m_cacheDesc = m_description;
|
|
||||||
}
|
}
|
||||||
|
// Windowed fullscreen.
|
||||||
desc.decoration = DisplayDecorate::None;
|
else if (mode == WINDOWEDFULLSCREEN) {
|
||||||
} else {
|
DisplayMode desktop = DisplayMode::getDesktopMode();
|
||||||
desc = m_cacheDesc;
|
m_impl->setDecoration(DisplayDecorate::None);
|
||||||
|
m_impl->setSize(desktop.width, desktop.height);
|
||||||
|
}
|
||||||
|
// Window mode.
|
||||||
|
else {
|
||||||
|
// Set stored decoration.
|
||||||
|
m_impl->setDecoration(m_description.decoration);
|
||||||
}
|
}
|
||||||
|
|
||||||
create(desc);
|
|
||||||
|
|
||||||
m_fmode = mode;
|
m_fmode = mode;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue