1
0
mirror of synced 2025-01-18 09:04:52 +01:00

fix: Make sure texture multisampling framebuffer is being unbinded in all cases

#1653
This commit is contained in:
WerWolv 2024-05-08 23:08:45 +02:00
parent fdf9209605
commit 6602e800ac

View File

@ -119,6 +119,11 @@ namespace ImGuiExt {
glGenFramebuffers(1, &framebuffer);
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
// Unbind framebuffer on exit
ON_SCOPE_EXIT {
glBindFramebuffer(GL_FRAMEBUFFER, 0);
};
// Attach texture to color attachment 0
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, texture, 0);
@ -131,9 +136,6 @@ namespace ImGuiExt {
return texture;
}
// Unbind framebuffer
glBindFramebuffer(GL_FRAMEBUFFER, 0);
#endif
return texture;