mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Renderer: Add a base Initialize() method to match Shutdown()
This commit is contained in:
@ -811,6 +811,23 @@ bool Renderer::IsHeadless() const
|
||||
return m_main_gl_context->IsHeadless();
|
||||
}
|
||||
|
||||
bool Renderer::Initialize()
|
||||
{
|
||||
if (!::Renderer::Initialize())
|
||||
return false;
|
||||
|
||||
// Initialize the FramebufferManager
|
||||
g_framebuffer_manager = std::make_unique<FramebufferManager>(
|
||||
m_target_width, m_target_height, s_MSAASamples, BoundingBox::NeedsStencilBuffer());
|
||||
m_current_framebuffer_width = m_target_width;
|
||||
m_current_framebuffer_height = m_target_height;
|
||||
|
||||
m_post_processor = std::make_unique<OpenGLPostProcessing>();
|
||||
s_raster_font = std::make_unique<RasterFont>();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Renderer::Shutdown()
|
||||
{
|
||||
::Renderer::Shutdown();
|
||||
@ -822,18 +839,6 @@ void Renderer::Shutdown()
|
||||
m_post_processor.reset();
|
||||
}
|
||||
|
||||
void Renderer::Init()
|
||||
{
|
||||
// Initialize the FramebufferManager
|
||||
g_framebuffer_manager = std::make_unique<FramebufferManager>(
|
||||
m_target_width, m_target_height, s_MSAASamples, BoundingBox::NeedsStencilBuffer());
|
||||
m_current_framebuffer_width = m_target_width;
|
||||
m_current_framebuffer_height = m_target_height;
|
||||
|
||||
m_post_processor = std::make_unique<OpenGLPostProcessing>();
|
||||
s_raster_font = std::make_unique<RasterFont>();
|
||||
}
|
||||
|
||||
std::unique_ptr<AbstractTexture> Renderer::CreateTexture(const TextureConfig& config)
|
||||
{
|
||||
return std::make_unique<OGLTexture>(config);
|
||||
|
@ -88,7 +88,7 @@ public:
|
||||
|
||||
bool IsHeadless() const override;
|
||||
|
||||
void Init();
|
||||
bool Initialize() override;
|
||||
void Shutdown() override;
|
||||
|
||||
std::unique_ptr<AbstractTexture> CreateTexture(const TextureConfig& config) override;
|
||||
|
@ -179,7 +179,8 @@ bool VideoBackend::Initialize(const WindowSystemInfo& wsi)
|
||||
g_texture_cache = std::make_unique<TextureCache>();
|
||||
g_sampler_cache = std::make_unique<SamplerCache>();
|
||||
g_shader_cache = std::make_unique<VideoCommon::ShaderCache>();
|
||||
static_cast<Renderer*>(g_renderer.get())->Init();
|
||||
if (!g_renderer->Initialize())
|
||||
return false;
|
||||
TextureConverter::Init();
|
||||
BoundingBox::Init(g_renderer->GetTargetWidth(), g_renderer->GetTargetHeight());
|
||||
return g_shader_cache->Initialize();
|
||||
|
Reference in New Issue
Block a user