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

@ -225,6 +225,11 @@ void Renderer::Create3DVisionTexture(int width, int height)
DXGI_FORMAT_R8G8B8A8_UNORM, 1, 1, &sys_data);
}
bool Renderer::IsHeadless() const
{
return D3D::swapchain == nullptr;
}
std::unique_ptr<AbstractTexture> Renderer::CreateTexture(const TextureConfig& config)
{
return std::make_unique<DXTexture>(config);
@ -698,12 +703,12 @@ void Renderer::CheckForSurfaceChange()
if (!m_surface_changed.TestAndClear())
return;
m_surface_handle = m_new_surface_handle;
m_new_surface_handle = nullptr;
SAFE_RELEASE(m_screenshot_texture);
SAFE_RELEASE(m_3d_vision_texture);
D3D::Reset(reinterpret_cast<HWND>(m_new_surface_handle));
m_new_surface_handle = nullptr;
UpdateBackbufferSize();
}

View File

@ -22,6 +22,9 @@ public:
~Renderer() override;
StateCache& GetStateCache() { return m_state_cache; }
bool IsHeadless() const override;
std::unique_ptr<AbstractTexture> CreateTexture(const TextureConfig& config) override;
std::unique_ptr<AbstractStagingTexture>
CreateStagingTexture(StagingTextureType type, const TextureConfig& config) override;

View File

@ -11,7 +11,7 @@ namespace DX11
{
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;
@ -19,4 +19,4 @@ class VideoBackend : public VideoBackendBase
void InitBackendInfo() override;
};
}
} // namespace DX11

View File

@ -127,7 +127,7 @@ void VideoBackend::InitBackendInfo()
DX11::D3D::UnloadD3D();
}
bool VideoBackend::Initialize(void* window_handle)
bool VideoBackend::Initialize(void* display_handle, void* window_handle)
{
if (window_handle == nullptr)
return false;
@ -188,4 +188,4 @@ void VideoBackend::Shutdown()
D3D::Close();
}
}
} // namespace DX11