]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture2d.cpp
Rewrite Bind as two different classes
[libs/gl.git] / source / texture2d.cpp
index 7a9701f5e616f448465c1335f695b871d3d34d04..973afebfcf277b75d217e2d0262e83846e06e41a 100644 (file)
@@ -46,7 +46,7 @@ void Texture2D::image(unsigned level, PixelFormat fmt, DataType type, const void
        unsigned h = height;
        get_level_size(level, w, h);
 
-       Bind _bind(this, true);
+       BindRestore _bind(this);
        glTexImage2D(target, level, ifmt, w, h, 0, fmt, type, data);
 
        allocated |= 1<<level;
@@ -64,7 +64,7 @@ void Texture2D::sub_image(unsigned level, int x, int y, unsigned wd, unsigned ht
 
        allocate(level);
 
-       Bind _bind(this, true);
+       BindRestore _bind(this);
        glTexSubImage2D(target, level, x, y, wd, ht, fmt, type, data);
 }
 
@@ -87,7 +87,7 @@ void Texture2D::image(const Graphics::Image &img)
                throw incompatible_data("Texture2D::image");
 
        PixelStore pstore = PixelStore::from_image(img);
-       Bind _bind_ps(pstore, true);
+       BindRestore _bind_ps(pstore);
 
        image(0, fmt, UNSIGNED_BYTE, img.get_data());
 }