rpcsx/rpcs3/Emu/RSX/GSRender.cpp

55 lines
682 B
C++
Raw Normal View History

2020-12-05 13:08:24 +01:00
#include "stdafx.h"
#include "GSRender.h"
2017-05-20 13:45:02 +02:00
GSRender::GSRender()
2021-04-09 21:12:47 +02:00
: m_context(nullptr)
{
2019-06-20 15:51:50 +02:00
if (auto gs_frame = Emu.GetCallbacks().get_gs_frame())
{
m_frame = gs_frame.release();
}
else
{
m_frame = nullptr;
}
}
GSRender::~GSRender()
{
m_context = nullptr;
if (m_frame)
{
m_frame->close();
}
}
2015-11-26 09:06:29 +01:00
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();
}
2021-03-05 20:05:37 +01:00
void GSRender::flip(const rsx::display_flip_info_t&)
{
if (m_frame)
2015-11-26 09:06:29 +01:00
{
m_frame->flip(m_context);
2015-11-26 09:06:29 +01:00
}
2015-10-21 09:24:02 +02:00
}