|
|
|
@ -81,6 +81,7 @@ Int Framebuffer::maxColorAttachments() { |
|
|
|
|
|
|
|
|
|
|
|
Framebuffer::Framebuffer(const Range2Di& viewport) { |
|
|
|
Framebuffer::Framebuffer(const Range2Di& viewport) { |
|
|
|
_viewport = viewport; |
|
|
|
_viewport = viewport; |
|
|
|
|
|
|
|
_created = false; |
|
|
|
|
|
|
|
|
|
|
|
glGenFramebuffers(1, &_id); |
|
|
|
glGenFramebuffers(1, &_id); |
|
|
|
CORRADE_INTERNAL_ASSERT(_id != Implementation::State::DisengagedBinding); |
|
|
|
CORRADE_INTERNAL_ASSERT(_id != Implementation::State::DisengagedBinding); |
|
|
|
@ -108,11 +109,13 @@ Framebuffer::~Framebuffer() { |
|
|
|
glDeleteFramebuffers(1, &_id); |
|
|
|
glDeleteFramebuffers(1, &_id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
std::string Framebuffer::label() const { |
|
|
|
std::string Framebuffer::label() { |
|
|
|
|
|
|
|
createIfNotAlready(); |
|
|
|
return Context::current()->state().debug->getLabelImplementation(GL_FRAMEBUFFER, _id); |
|
|
|
return Context::current()->state().debug->getLabelImplementation(GL_FRAMEBUFFER, _id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Framebuffer& Framebuffer::setLabelInternal(const Containers::ArrayReference<const char> label) { |
|
|
|
Framebuffer& Framebuffer::setLabelInternal(const Containers::ArrayReference<const char> label) { |
|
|
|
|
|
|
|
createIfNotAlready(); |
|
|
|
Context::current()->state().debug->labelImplementation(GL_FRAMEBUFFER, _id, label); |
|
|
|
Context::current()->state().debug->labelImplementation(GL_FRAMEBUFFER, _id, label); |
|
|
|
return *this; |
|
|
|
return *this; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -255,6 +258,7 @@ void Framebuffer::renderbufferImplementationDefault(BufferAttachment attachment, |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
void Framebuffer::renderbufferImplementationDSA(BufferAttachment attachment, Renderbuffer& renderbuffer) { |
|
|
|
void Framebuffer::renderbufferImplementationDSA(BufferAttachment attachment, Renderbuffer& renderbuffer) { |
|
|
|
|
|
|
|
_created = true; |
|
|
|
glNamedFramebufferRenderbufferEXT(_id, GLenum(attachment), GL_RENDERBUFFER, renderbuffer.id()); |
|
|
|
glNamedFramebufferRenderbufferEXT(_id, GLenum(attachment), GL_RENDERBUFFER, renderbuffer.id()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -263,6 +267,7 @@ void Framebuffer::texture1DImplementationDefault(BufferAttachment attachment, GL |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Framebuffer::texture1DImplementationDSA(BufferAttachment attachment, GLuint textureId, GLint mipLevel) { |
|
|
|
void Framebuffer::texture1DImplementationDSA(BufferAttachment attachment, GLuint textureId, GLint mipLevel) { |
|
|
|
|
|
|
|
_created = true; |
|
|
|
glNamedFramebufferTexture1DEXT(_id, GLenum(attachment), GL_TEXTURE_1D, textureId, mipLevel); |
|
|
|
glNamedFramebufferTexture1DEXT(_id, GLenum(attachment), GL_TEXTURE_1D, textureId, mipLevel); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
@ -273,6 +278,7 @@ void Framebuffer::texture2DImplementationDefault(BufferAttachment attachment, GL |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
void Framebuffer::texture2DImplementationDSA(BufferAttachment attachment, GLenum textureTarget, GLuint textureId, GLint mipLevel) { |
|
|
|
void Framebuffer::texture2DImplementationDSA(BufferAttachment attachment, GLenum textureTarget, GLuint textureId, GLint mipLevel) { |
|
|
|
|
|
|
|
_created = true; |
|
|
|
glNamedFramebufferTexture2DEXT(_id, GLenum(attachment), textureTarget, textureId, mipLevel); |
|
|
|
glNamedFramebufferTexture2DEXT(_id, GLenum(attachment), textureTarget, textureId, mipLevel); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
@ -293,6 +299,7 @@ void Framebuffer::textureLayerImplementationDefault(BufferAttachment attachment, |
|
|
|
|
|
|
|
|
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
#ifndef MAGNUM_TARGET_GLES |
|
|
|
void Framebuffer::textureLayerImplementationDSA(BufferAttachment attachment, GLuint textureId, GLint mipLevel, GLint layer) { |
|
|
|
void Framebuffer::textureLayerImplementationDSA(BufferAttachment attachment, GLuint textureId, GLint mipLevel, GLint layer) { |
|
|
|
|
|
|
|
_created = true; |
|
|
|
glNamedFramebufferTextureLayerEXT(_id, GLenum(attachment), textureId, mipLevel, layer); |
|
|
|
glNamedFramebufferTextureLayerEXT(_id, GLenum(attachment), textureId, mipLevel, layer); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|