]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/texture2d.cpp
Decouple DataType from the OpenGL constants
[libs/gl.git] / source / core / texture2d.cpp
index 0e76128c7bc5666da5828f11fe98f5398ecaf380..d2addda70fc4d6e35de11e2df472bf98b89d9940 100644 (file)
@@ -106,7 +106,7 @@ void Texture2D::image(unsigned level, const void *data)
        }
 
        PixelComponents comp = get_components(storage_fmt);
-       DataType type = get_component_type(storage_fmt);
+       GLenum type = get_gl_type(get_component_type(storage_fmt));
        glTexImage2D(target, level, storage_fmt, w, h, 0, comp, type, data);
 
        allocated |= 1<<level;
@@ -133,7 +133,7 @@ void Texture2D::sub_image(unsigned level, int x, int y, unsigned wd, unsigned ht
        allocate(level);
 
        PixelComponents comp = get_components(storage_fmt);
-       DataType type = get_component_type(storage_fmt);
+       GLenum type = get_gl_type(get_component_type(storage_fmt));
        if(ARB_direct_state_access)
                glTextureSubImage2D(id, level, x, y, wd, ht, comp, type, data);
        else