do OGL surface resizing from the mainthread

This commit is contained in:
RSDuck 2022-10-13 19:23:49 +02:00
parent d82f08e98d
commit 92951b6f04
2 changed files with 9 additions and 12 deletions

View File

@ -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;

View File

@ -112,8 +112,7 @@ private:
int numScreens;
bool filter;
int lastScreenWidth = -1;
int lastScreenHeight = -1;
int lastScreenWidth = -1, lastScreenHeight = -1;
};