fix: Make sure texture multisampling framebuffer is being unbinded in all cases
#1653
This commit is contained in:
parent
fdf9209605
commit
6602e800ac
@ -119,6 +119,11 @@ namespace ImGuiExt {
|
|||||||
glGenFramebuffers(1, &framebuffer);
|
glGenFramebuffers(1, &framebuffer);
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
|
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
|
||||||
|
|
||||||
|
// Unbind framebuffer on exit
|
||||||
|
ON_SCOPE_EXIT {
|
||||||
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||||
|
};
|
||||||
|
|
||||||
// Attach texture to color attachment 0
|
// Attach texture to color attachment 0
|
||||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, texture, 0);
|
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, texture, 0);
|
||||||
|
|
||||||
@ -131,9 +136,6 @@ namespace ImGuiExt {
|
|||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unbind framebuffer
|
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return texture;
|
return texture;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user