mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
clear empty frame buffer fix
thanks sam!
This commit is contained in:
parent
883aa7af8d
commit
4e3cfd7c49
1 changed files with 13 additions and 6 deletions
|
@ -231,14 +231,21 @@ void GLBackend::do_clearFramebuffer(Batch& batch, uint32 paramOffset) {
|
|||
|
||||
std::vector<GLenum> drawBuffers;
|
||||
if (masks & Framebuffer::BUFFER_COLORS) {
|
||||
for (unsigned int i = 0; i < Framebuffer::MAX_NUM_RENDER_BUFFERS; i++) {
|
||||
if (masks & (1 << i)) {
|
||||
drawBuffers.push_back(GL_COLOR_ATTACHMENT0 + i);
|
||||
if (_output._framebuffer) {
|
||||
for (unsigned int i = 0; i < Framebuffer::MAX_NUM_RENDER_BUFFERS; i++) {
|
||||
if (masks & (1 << i)) {
|
||||
drawBuffers.push_back(GL_COLOR_ATTACHMENT0 + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!drawBuffers.empty()) {
|
||||
glDrawBuffers(drawBuffers.size(), drawBuffers.data());
|
||||
if (!drawBuffers.empty()) {
|
||||
glDrawBuffers(drawBuffers.size(), drawBuffers.data());
|
||||
glClearColor(color.x, color.y, color.z, color.w);
|
||||
glmask |= GL_COLOR_BUFFER_BIT;
|
||||
|
||||
(void) CHECK_GL_ERROR();
|
||||
}
|
||||
} else {
|
||||
glClearColor(color.x, color.y, color.z, color.w);
|
||||
glmask |= GL_COLOR_BUFFER_BIT;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue