mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 14:19:55 -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();
|
||||
|
||||
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->windowInfo = windowInfo;
|
||||
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)
|
||||
{
|
||||
EmuStatus = 1;
|
||||
|
@ -112,8 +112,7 @@ private:
|
||||
int numScreens;
|
||||
bool filter;
|
||||
|
||||
int lastScreenWidth = -1;
|
||||
int lastScreenHeight = -1;
|
||||
int lastScreenWidth = -1, lastScreenHeight = -1;
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user