Renderer: RenderWindow now requires a RenderDevice

This commit is contained in:
Lynix
2021-05-16 23:13:00 +02:00
parent 40772f2137
commit 13feaf4aab
30 changed files with 132 additions and 107 deletions

View File

@@ -41,11 +41,11 @@ namespace Nz
DummySurface* dummySurface = static_cast<DummySurface*>(surface);
OpenGLRenderer* glRenderer = static_cast<OpenGLRenderer*>(renderer);
m_device = std::static_pointer_cast<OpenGLDevice>(glRenderer->InstanciateRenderDevice(0));
OpenGLDevice& device = static_cast<OpenGLDevice&>(*m_owner.GetRenderDevice());
GL::ContextParams contextParams;
m_context = m_device->CreateContext(contextParams, dummySurface->GetWindowHandle());
m_context = device.CreateContext(contextParams, dummySurface->GetWindowHandle());
if (!m_context)
return false;
@@ -75,11 +75,6 @@ namespace Nz
return m_renderPass;
}
std::shared_ptr<RenderDevice> OpenGLRenderWindow::GetRenderDevice()
{
return m_device;
}
void OpenGLRenderWindow::Present()
{
m_context->SwapBuffers();