GlOffscreen: create color/depth renderbuffers separately.
This fixes a strange problem where GTK 2 (but not GTK 3) with NVidia drivers would not have a depth buffer, but only during exporting PNGs, despite the fact that normal rendering path and PNG rendering path come through the same offscreen rendering code.pull/36/head
parent
991909d794
commit
a1e18ae4a6
|
@ -22,11 +22,12 @@ void GlOffscreen::Clear() {
|
|||
bool GlOffscreen::Render(int width, int height, std::function<void()> renderFn) {
|
||||
data.resize(width * height * 4);
|
||||
|
||||
if(framebuffer == 0) {
|
||||
if(framebuffer == 0)
|
||||
glGenFramebuffersEXT(1, &framebuffer);
|
||||
if(colorRenderbuffer == 0)
|
||||
glGenRenderbuffersEXT(1, &colorRenderbuffer);
|
||||
if(depthRenderbuffer == 0)
|
||||
glGenRenderbuffersEXT(1, &depthRenderbuffer);
|
||||
}
|
||||
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer);
|
||||
|
||||
|
|
Loading…
Reference in New Issue