X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fframebuffer.cpp;h=c4f714c64b7768e74989602ac023ce3e14655159;hb=8c24084524198e23d65058454001ffb0bf20e94f;hp=6877f4808b7402c7f1660097c3860bb7fcbbe5bc;hpb=2e7f19b895424c3a77940e648639f8df2b395d0f;p=libs%2Fgl.git diff --git a/source/framebuffer.cpp b/source/framebuffer.cpp index 6877f480..c4f714c6 100644 --- a/source/framebuffer.cpp +++ b/source/framebuffer.cpp @@ -60,6 +60,11 @@ void Framebuffer::update_attachment(unsigned mask) const static_cast(attch.tex)->allocate(attch.level); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, attch.attachment, attch.type, attch.tex->get_id(), attch.level); } + else if(attch.type==GL_TEXTURE_CUBE_MAP) + { + static_cast(attch.tex)->allocate(attch.level); + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, attch.attachment, attch.cube_face, attch.tex->get_id(), attch.level); + } else glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, attch.attachment, 0, 0); } @@ -90,12 +95,26 @@ void Framebuffer::check_size() width = tex->get_width(); height = tex->get_height(); } + else if(i->type==GL_TEXTURE_CUBE_MAP) + { + width = static_cast(i->tex)->get_size(); + height = width; + } if(current()==this) glViewport(0, 0, width, height); break; } } +unsigned Framebuffer::get_attachment_index(FramebufferAttachment attch) +{ + for(unsigned i=0; i