Drop Host_GetRenderSurface and pass display to backend

This commit is contained in:
Stenzek
2018-10-03 23:03:13 +10:00
parent 134d967be2
commit a3961750a7
35 changed files with 129 additions and 124 deletions

View File

@ -804,6 +804,11 @@ Renderer::Renderer()
Renderer::~Renderer() = default;
bool Renderer::IsHeadless() const
{
return g_main_gl_context->IsHeadless();
}
void Renderer::Shutdown()
{
::Renderer::Shutdown();
@ -1499,9 +1504,8 @@ void Renderer::CheckForSurfaceChange()
if (!m_surface_changed.TestAndClear())
return;
m_surface_handle = m_new_surface_handle;
g_main_gl_context->UpdateSurface(m_new_surface_handle);
m_new_surface_handle = nullptr;
g_main_gl_context->UpdateSurface(m_surface_handle);
// With a surface change, the window likely has new dimensions.
m_backbuffer_width = g_main_gl_context->GetBackBufferWidth();

View File

@ -84,6 +84,8 @@ public:
Renderer();
~Renderer() override;
bool IsHeadless() const override;
void Init();
void Shutdown() override;

View File

@ -11,7 +11,7 @@ namespace OGL
{
class VideoBackend : public VideoBackendBase
{
bool Initialize(void*) override;
bool Initialize(void* display_handle, void* window_handle) override;
void Shutdown() override;
std::string GetName() const override;
@ -23,4 +23,4 @@ private:
bool InitializeGLExtensions();
bool FillBackendInfo();
};
}
} // namespace OGL

View File

@ -157,7 +157,7 @@ bool VideoBackend::FillBackendInfo()
return true;
}
bool VideoBackend::Initialize(void* window_handle)
bool VideoBackend::Initialize(void* display_handle, void* window_handle)
{
InitializeShared();