Fix issue where binding msaa canvas could fail;
@@ -715,8 +715,12 @@ void lovrGpuDraw(DrawCommand* command) {
GLenum buffers[MAX_CANVASES];
for (int i = 0; i < canvasCount; i++) {
buffers[i] = GL_COLOR_ATTACHMENT0 + i;
+ if (canvas[i]->flags.msaa > 0) {
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER, buffers[i], GL_RENDERBUFFER, canvas[i]->msaaTexture);
+ } else {
glFramebufferTexture2D(GL_FRAMEBUFFER, buffers[i], GL_TEXTURE_2D, lovrTextureGetId((Texture*) canvas[i]), 0);
}
+ }
glDrawBuffers(canvasCount, buffers);
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
