mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-27 00:00:07 -06:00
do OGL surface resizing from the mainthread
This commit is contained in:
@ -379,6 +379,14 @@ void EmuThread::updateScreenSettings(bool filter, const WindowInfo& windowInfo,
|
|||||||
{
|
{
|
||||||
screenSettingsLock.lock();
|
screenSettingsLock.lock();
|
||||||
|
|
||||||
|
if (lastScreenWidth != windowInfo.surface_width || lastScreenHeight != windowInfo.surface_height)
|
||||||
|
{
|
||||||
|
if (oglContext)
|
||||||
|
oglContext->ResizeSurface(windowInfo.surface_width, windowInfo.surface_height);
|
||||||
|
lastScreenWidth = windowInfo.surface_width;
|
||||||
|
lastScreenHeight = windowInfo.surface_height;
|
||||||
|
}
|
||||||
|
|
||||||
this->filter = filter;
|
this->filter = filter;
|
||||||
this->windowInfo = windowInfo;
|
this->windowInfo = windowInfo;
|
||||||
this->numScreens = numScreens;
|
this->numScreens = numScreens;
|
||||||
@ -553,16 +561,6 @@ void EmuThread::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
screenSettingsLock.lock();
|
|
||||||
if (lastScreenWidth != windowInfo.surface_width || lastScreenHeight != windowInfo.surface_height)
|
|
||||||
{
|
|
||||||
if (oglContext)
|
|
||||||
oglContext->ResizeSurface(windowInfo.surface_width, windowInfo.surface_height);
|
|
||||||
lastScreenWidth = windowInfo.surface_width;
|
|
||||||
lastScreenHeight = windowInfo.surface_height;
|
|
||||||
}
|
|
||||||
screenSettingsLock.unlock();
|
|
||||||
|
|
||||||
if (EmuRunning == 1 || EmuRunning == 3)
|
if (EmuRunning == 1 || EmuRunning == 3)
|
||||||
{
|
{
|
||||||
EmuStatus = 1;
|
EmuStatus = 1;
|
||||||
|
@ -112,8 +112,7 @@ private:
|
|||||||
int numScreens;
|
int numScreens;
|
||||||
bool filter;
|
bool filter;
|
||||||
|
|
||||||
int lastScreenWidth = -1;
|
int lastScreenWidth = -1, lastScreenHeight = -1;
|
||||||
int lastScreenHeight = -1;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user