mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-08-22 22:40:53 +00:00
Avoid recreating the GL context on Alt+Tab, resolution change, or windowed/fullscreen switch
This commit is contained in:
parent
b8aaccd7a1
commit
1bad4d006d
8 changed files with 184 additions and 283 deletions
|
@ -230,27 +230,11 @@ DSQ::~DSQ()
|
|||
dsq = 0;
|
||||
}
|
||||
|
||||
void DSQ::onAltTab()
|
||||
{
|
||||
if (getAltState())
|
||||
{
|
||||
if (!core->isNested())
|
||||
{
|
||||
if (_fullscreen)
|
||||
{
|
||||
core->toggleScreenMode(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// actually toggle
|
||||
void DSQ::toggleFullscreen()
|
||||
{
|
||||
|
||||
core->toggleScreenMode(!_fullscreen);
|
||||
setFullscreen(!_fullscreen);
|
||||
user.video.full = _fullscreen;
|
||||
|
||||
}
|
||||
|
||||
// for handling the input, not the actual switch functionality
|
||||
|
|
|
@ -514,7 +514,6 @@ protected:
|
|||
void reloadDevice();
|
||||
|
||||
void onSwitchScreenMode();
|
||||
void onAltTab();
|
||||
|
||||
void onPlayVoice();
|
||||
void onStopVoice();
|
||||
|
|
|
@ -3252,7 +3252,7 @@ void InGameMenu::onOptionsSave()
|
|||
|| dsq->user.video.full != dsq->user_backup.video.full
|
||||
|| dsq->user.video.vsync != dsq->user_backup.video.vsync)
|
||||
{
|
||||
dsq->resetGraphics(dsq->user.video.resx, dsq->user.video.resy, dsq->user.video.full);
|
||||
dsq->initGraphics(dsq->user.video.resx, dsq->user.video.resy, dsq->user.video.full);
|
||||
if (dsq->confirm("", "graphics", false, 10)) {
|
||||
} else {
|
||||
dsq->user.video.resx = dsq->user_backup.video.resx;
|
||||
|
@ -3263,7 +3263,7 @@ void InGameMenu::onOptionsSave()
|
|||
|
||||
dsq->user.apply();
|
||||
|
||||
dsq->resetGraphics(dsq->user.video.resx, dsq->user.video.resy, dsq->user.video.full);
|
||||
dsq->initGraphics(dsq->user.video.resx, dsq->user.video.resy, dsq->user.video.full);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -462,7 +462,7 @@ void Nag::onBuy()
|
|||
|
||||
if (core->isFullscreen())
|
||||
{
|
||||
core->toggleScreenMode(0);
|
||||
core->setFullscreen(false);
|
||||
dsq->run(0.6);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue