- if(attch.type==GL_RENDERBUFFER)
- glFramebufferRenderbuffer(GL_FRAMEBUFFER, attch.attachment, GL_RENDERBUFFER, attch.rbuf->get_id());
- else if(attch.type==GL_TEXTURE_2D)
- {
- static_cast<Texture2D *>(attch.tex)->allocate(attch.level);
- glFramebufferTexture2D(GL_FRAMEBUFFER, attch.attachment, attch.type, attch.tex->get_id(), attch.level);
- }
- else if(attch.type==GL_TEXTURE_CUBE_MAP)
- {
- static_cast<TextureCube *>(attch.tex)->allocate(attch.level);
- glFramebufferTexture2D(GL_FRAMEBUFFER, attch.attachment, attch.cube_face, attch.tex->get_id(), attch.level);
- }
- else
- glFramebufferRenderbuffer(GL_FRAMEBUFFER, attch.attachment, 0, 0);
+ static_cast<Texture2D *>(attch.tex)->allocate(attch.level);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, attch.attachment, attch.type, attch.tex->get_id(), attch.level);