mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 06:25:37 +00:00
parent
b86e0bc846
commit
afe2f96474
|
@ -24,8 +24,6 @@ public:
|
||||||
virtual bool initializeDeviceContext(bool debug_device);
|
virtual bool initializeDeviceContext(bool debug_device);
|
||||||
virtual void destroyDeviceContext();
|
virtual void destroyDeviceContext();
|
||||||
|
|
||||||
virtual void Render() = 0;
|
|
||||||
|
|
||||||
// this comes back on the emu thread
|
// this comes back on the emu thread
|
||||||
virtual void windowResized(s32 new_window_width, s32 new_window_height);
|
virtual void windowResized(s32 new_window_width, s32 new_window_height);
|
||||||
|
|
||||||
|
|
|
@ -214,8 +214,14 @@ void QtHostInterface::handleKeyEvent(int key, bool pressed)
|
||||||
void QtHostInterface::onDisplayWidgetResized(int width, int height)
|
void QtHostInterface::onDisplayWidgetResized(int width, int height)
|
||||||
{
|
{
|
||||||
// this can be null if it was destroyed and the main thread is late catching up
|
// this can be null if it was destroyed and the main thread is late catching up
|
||||||
if (m_display_widget)
|
if (!m_display_widget)
|
||||||
|
return;
|
||||||
|
|
||||||
m_display_widget->windowResized(width, height);
|
m_display_widget->windowResized(width, height);
|
||||||
|
|
||||||
|
// re-render the display, since otherwise it will be out of date and stretched if paused
|
||||||
|
if (m_system)
|
||||||
|
renderDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QtHostInterface::AcquireHostDisplay()
|
bool QtHostInterface::AcquireHostDisplay()
|
||||||
|
@ -699,14 +705,7 @@ void QtHostInterface::threadEntryPoint()
|
||||||
|
|
||||||
m_system->RunFrame();
|
m_system->RunFrame();
|
||||||
|
|
||||||
m_system->GetGPU()->ResetGraphicsAPIState();
|
renderDisplay();
|
||||||
|
|
||||||
DrawDebugWindows();
|
|
||||||
DrawOSDMessages();
|
|
||||||
|
|
||||||
m_display->Render();
|
|
||||||
|
|
||||||
m_system->GetGPU()->RestoreGraphicsAPIState();
|
|
||||||
|
|
||||||
if (m_speed_limiter_enabled)
|
if (m_speed_limiter_enabled)
|
||||||
m_system->Throttle();
|
m_system->Throttle();
|
||||||
|
@ -727,6 +726,18 @@ void QtHostInterface::threadEntryPoint()
|
||||||
moveToThread(m_original_thread);
|
moveToThread(m_original_thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtHostInterface::renderDisplay()
|
||||||
|
{
|
||||||
|
m_system->GetGPU()->ResetGraphicsAPIState();
|
||||||
|
|
||||||
|
DrawDebugWindows();
|
||||||
|
DrawOSDMessages();
|
||||||
|
|
||||||
|
m_display->Render();
|
||||||
|
|
||||||
|
m_system->GetGPU()->RestoreGraphicsAPIState();
|
||||||
|
}
|
||||||
|
|
||||||
void QtHostInterface::wakeThread()
|
void QtHostInterface::wakeThread()
|
||||||
{
|
{
|
||||||
if (isOnWorkerThread())
|
if (isOnWorkerThread())
|
||||||
|
|
|
@ -157,6 +157,7 @@ private:
|
||||||
void createThread();
|
void createThread();
|
||||||
void stopThread();
|
void stopThread();
|
||||||
void threadEntryPoint();
|
void threadEntryPoint();
|
||||||
|
void renderDisplay();
|
||||||
void wakeThread();
|
void wakeThread();
|
||||||
|
|
||||||
QSettings m_qsettings;
|
QSettings m_qsettings;
|
||||||
|
|
Loading…
Reference in a new issue