X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fcore%2Fframebuffer.cpp;h=0ce00becd23d5503ca5f26fec5f13eab065f9f17;hp=6e7d9dc9971878a7647f26ecf49be6f10fd54712;hb=e9a898f;hpb=bdef3de6559629f25121de2e014383d7f773266b diff --git a/source/core/framebuffer.cpp b/source/core/framebuffer.cpp index 6e7d9dc9..0ce00bec 100644 --- a/source/core/framebuffer.cpp +++ b/source/core/framebuffer.cpp @@ -201,33 +201,33 @@ void Framebuffer::update() const void Framebuffer::check_size() { bool first = true; - for(vector::iterator i=attachments.begin(); i!=attachments.end(); ++i) - if(i->tex) + for(Attachment &a: attachments) + if(a.tex) { - GLenum type = i->tex->get_target(); + GLenum type = a.tex->get_target(); unsigned w = 0; unsigned h = 0; if(type==GL_TEXTURE_2D) { - Texture2D *tex = static_cast(i->tex); - w = max(tex->get_width()>>i->level, 1U); - h = max(tex->get_height()>>i->level, 1U); + Texture2D *tex = static_cast(a.tex); + w = max(tex->get_width()>>a.level, 1U); + h = max(tex->get_height()>>a.level, 1U); } else if(type==GL_TEXTURE_2D_MULTISAMPLE) { - Texture2DMultisample *tex = static_cast(i->tex); + Texture2DMultisample *tex = static_cast(a.tex); w = tex->get_width(); h = tex->get_height(); } else if(type==GL_TEXTURE_3D || type==GL_TEXTURE_2D_ARRAY) { - Texture3D *tex = static_cast(i->tex); - w = max(tex->get_width()>>i->level, 1U); - h = max(tex->get_height()>>i->level, 1U); + Texture3D *tex = static_cast(a.tex); + w = max(tex->get_width()>>a.level, 1U); + h = max(tex->get_height()>>a.level, 1U); } else if(type==GL_TEXTURE_CUBE_MAP) { - w = max(static_cast(i->tex)->get_size()>>i->level, 1U); + w = max(static_cast(a.tex)->get_size()>>a.level, 1U); h = w; }