OpenGLRenderer: Setup draw buffers only once
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user