OpenGLRenderer: Improve/fix Framebuffer handling

This commit is contained in:
Jérôme Leclercq
2021-09-21 17:37:03 +02:00
parent 78358337f3
commit 4933a389a2
8 changed files with 43 additions and 57 deletions

View File

@@ -13,7 +13,7 @@ namespace Nz
OpenGLFboFramebuffer::OpenGLFboFramebuffer(OpenGLDevice& device, const std::vector<std::shared_ptr<Texture>>& attachments) :
OpenGLFramebuffer(FramebufferType::Texture)
{
if (!m_framebuffer.Create(device))
if (!m_framebuffer.Create(device.GetReferenceContext()))
throw std::runtime_error("failed to create framebuffer object");
std::size_t colorAttachmentCount = 0;
@@ -80,7 +80,7 @@ namespace Nz
void OpenGLFboFramebuffer::Activate() const
{
const GL::Context& context = m_framebuffer.EnsureDeviceContext();
const GL::Context& context = m_framebuffer.EnsureContext();
context.BindFramebuffer(GL::FramebufferTarget::Draw, m_framebuffer.GetObjectId());
}