mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-31 22:00:10 +01:00
- Removes a lot of wm_event code that was used to perform window management and is no longer needed. - Significantly simplifies the vulkan code. - Implements resource management when vulkan window is minimized to allow resources to be freed.
58 lines
729 B
C++
58 lines
729 B
C++
#include "stdafx.h"
|
|
#include "Emu/Memory/vm.h"
|
|
#include "Emu/System.h"
|
|
|
|
#include "GSRender.h"
|
|
|
|
GSRender::GSRender()
|
|
{
|
|
m_frame = Emu.GetCallbacks().get_gs_frame().release();
|
|
}
|
|
|
|
GSRender::~GSRender()
|
|
{
|
|
m_context = nullptr;
|
|
|
|
if (m_frame)
|
|
{
|
|
m_frame->hide();
|
|
m_frame->close();
|
|
}
|
|
}
|
|
|
|
void GSRender::on_init_rsx()
|
|
{
|
|
if (m_frame)
|
|
{
|
|
m_frame->show();
|
|
}
|
|
}
|
|
|
|
void GSRender::on_init_thread()
|
|
{
|
|
if (m_frame)
|
|
{
|
|
m_context = m_frame->make_context();
|
|
m_frame->set_current(m_context);
|
|
}
|
|
}
|
|
|
|
void GSRender::on_exit()
|
|
{
|
|
if (m_frame)
|
|
{
|
|
m_frame->delete_context(m_context);
|
|
m_context = nullptr;
|
|
}
|
|
|
|
rsx::thread::on_exit();
|
|
}
|
|
|
|
void GSRender::flip(int buffer, bool emu_flip)
|
|
{
|
|
if (m_frame)
|
|
{
|
|
m_frame->flip(m_context);
|
|
}
|
|
}
|