mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
GLContext: Remove global context pointer
This commit is contained in:
@ -24,14 +24,15 @@
|
||||
#include "VideoCommon/VideoBackendBase.h"
|
||||
#include "VideoCommon/VideoConfig.h"
|
||||
|
||||
SWRenderer::SWRenderer()
|
||||
: ::Renderer(static_cast<int>(MAX_XFB_WIDTH), static_cast<int>(MAX_XFB_HEIGHT))
|
||||
SWRenderer::SWRenderer(std::unique_ptr<SWOGLWindow> window)
|
||||
: ::Renderer(static_cast<int>(MAX_XFB_WIDTH), static_cast<int>(MAX_XFB_HEIGHT)),
|
||||
m_window(std::move(window))
|
||||
{
|
||||
}
|
||||
|
||||
bool SWRenderer::IsHeadless() const
|
||||
{
|
||||
return g_main_gl_context->IsHeadless();
|
||||
return m_window->IsHeadless();
|
||||
}
|
||||
|
||||
std::unique_ptr<AbstractTexture> SWRenderer::CreateTexture(const TextureConfig& config)
|
||||
@ -55,7 +56,7 @@ SWRenderer::CreateFramebuffer(const AbstractTexture* color_attachment,
|
||||
|
||||
void SWRenderer::RenderText(const std::string& pstr, int left, int top, u32 color)
|
||||
{
|
||||
SWOGLWindow::s_instance->PrintText(pstr, left, top, color);
|
||||
m_window->PrintText(pstr, left, top, color);
|
||||
}
|
||||
|
||||
class SWShader final : public AbstractShader
|
||||
@ -100,7 +101,7 @@ void SWRenderer::SwapImpl(AbstractTexture* texture, const EFBRectangle& xfb_regi
|
||||
if (!IsHeadless())
|
||||
{
|
||||
DrawDebugText();
|
||||
SWOGLWindow::s_instance->ShowImage(texture, xfb_region);
|
||||
m_window->ShowImage(texture, xfb_region);
|
||||
}
|
||||
|
||||
UpdateActiveConfig();
|
||||
|
Reference in New Issue
Block a user