diff --git a/src/render/rendergl.cpp b/src/render/rendergl.cpp index 1e65e596..01ee8a5f 100644 --- a/src/render/rendergl.cpp +++ b/src/render/rendergl.cpp @@ -22,11 +22,12 @@ void GlOffscreen::Clear() { bool GlOffscreen::Render(int width, int height, std::function 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);