]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/framebuffer.cpp
Use standard fixed-size integer types
[libs/gl.git] / source / core / framebuffer.cpp
index 6e7d9dc9971878a7647f26ecf49be6f10fd54712..e9d8863ca16e4e0379a11e9777def136cb596d2e 100644 (file)
@@ -131,7 +131,7 @@ void Framebuffer::update() const
        vector<GLenum> color_bufs;
        color_bufs.reserve(format.size());
        unsigned i = 0;
-       for(const UInt16 *j=format.begin(); j!=format.end(); ++j, ++i)
+       for(const uint16_t *j=format.begin(); j!=format.end(); ++j, ++i)
        {
                GLenum gl_attach_point = get_gl_attachment(static_cast<FrameAttachment>(*j));
                if(dirty&(1<<i))
@@ -201,33 +201,33 @@ void Framebuffer::update() const
 void Framebuffer::check_size()
 {
        bool first = true;
-       for(vector<Attachment>::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<Texture2D *>(i->tex);
-                               w = max(tex->get_width()>>i->level, 1U);
-                               h = max(tex->get_height()>>i->level, 1U);
+                               Texture2D *tex = static_cast<Texture2D *>(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<Texture2DMultisample *>(i->tex);
+                               Texture2DMultisample *tex = static_cast<Texture2DMultisample *>(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<Texture3D *>(i->tex);
-                               w = max(tex->get_width()>>i->level, 1U);
-                               h = max(tex->get_height()>>i->level, 1U);
+                               Texture3D *tex = static_cast<Texture3D *>(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<TextureCube *>(i->tex)->get_size()>>i->level, 1U);
+                               w = max(static_cast<TextureCube *>(a.tex)->get_size()>>a.level, 1U);
                                h = w;
                        }
 
@@ -254,7 +254,7 @@ void Framebuffer::set_attachment(FrameAttachment attch, Texture &tex, unsigned l
                throw incompatible_data("Framebuffer::attach");
 
        unsigned i = 0;
-       for(const UInt16 *j=format.begin(); j!=format.end(); ++j, ++i)
+       for(const uint16_t *j=format.begin(); j!=format.end(); ++j, ++i)
                if(*j==attch)
                {
                        attachments[i].set(tex, level, layer);