OpenGLRenderer: Setup draw buffers only once

This commit is contained in:
SirLynix
2022-12-06 07:49:41 +01:00
parent 8eed1161e5
commit ccf77ac459
4 changed files with 26 additions and 7 deletions

View File

@@ -24,6 +24,7 @@ namespace Nz::GL
inline GLenum Check() const;
inline void DrawBuffers(GLsizei n, const GLenum* bufs);
inline void Renderbuffer(GLenum attachment, GLenum renderbuffer);
inline void Texture2D(GLenum attachment, GLenum textarget, GLuint texture, GLint level = 0);

View File

@@ -17,6 +17,15 @@ namespace Nz::GL
return context.glCheckFramebufferStatus(target);
}
inline void Framebuffer::DrawBuffers(GLsizei n, const GLenum* bufs)
{
assert(m_objectId);
const Context& context = EnsureContext();
context.BindFramebuffer(FramebufferTarget::Draw, m_objectId);
context.glDrawBuffers(n, bufs);
}
inline void Framebuffer::Renderbuffer(GLenum attachment, GLenum renderbuffer)
{
assert(m_objectId);