]> git.tdb.fi Git - libs/gl.git/blobdiff - source/texture2d.cpp
Add object-oriented interfaces for the various tests and blending
[libs/gl.git] / source / texture2d.cpp
index b8f2f26b7076320f78f5ef792dc69a9acd7e1b82..1c5a9d63212a7f8fd787186ca33902873d6ee1e0 100644 (file)
@@ -21,7 +21,7 @@ Texture2D::Texture2D():
        bind();
 }
 
-void Texture2D::storage(PixelFormat fmt, sizei wd, sizei ht, int brd)
+void Texture2D::storage(PixelFormat fmt, unsigned wd, unsigned ht, int brd)
 {
        if(width>0)
                throw InvalidState("Texture storage may only be specified once");
@@ -44,7 +44,7 @@ void Texture2D::image(int level, PixelFormat fmt, DataType type, const void *dat
        glTexImage2D(target, level, ifmt, width, height, border, fmt, type, data);
 }
 
-void Texture2D::sub_image(int level, int x, int y, sizei wd, sizei ht, PixelFormat fmt, DataType type, const void *data)
+void Texture2D::sub_image(int level, int x, int y, unsigned wd, unsigned ht, PixelFormat fmt, DataType type, const void *data)
 {
        if(width==0)
                throw InvalidState("Texture storage has not been specified");
@@ -89,18 +89,18 @@ void Texture2D::Loader::image_data(const string &data)
        Graphics::Image img;
        img.load_memory(data.data(), data.size());
 
-       static_cast<Texture2D &>(tex).image(img);
+       static_cast<Texture2D &>(obj).image(img);
 }
 
 void Texture2D::Loader::raw_data(const string &data)
 {
-       Texture2D &t2d=static_cast<Texture2D &>(tex);;
+       Texture2D &t2d=static_cast<Texture2D &>(obj);
        t2d.image(0, t2d.ifmt, UNSIGNED_BYTE, data.data());
 }
 
 void Texture2D::Loader::storage(PixelFormat fmt, unsigned w, unsigned h, unsigned b)
 {
-       static_cast<Texture2D &>(tex).storage(fmt, w, h, b);
+       static_cast<Texture2D &>(obj).storage(fmt, w, h, b);
 }
 
 } // namespace GL