]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/texture3d.cpp
Decouple DataType from the OpenGL constants
[libs/gl.git] / source / core / texture3d.cpp
index 03c58d0afdf05e6273cfbbea2892ea2d7e067ca9..1681f83c6f528b949be627adb9fddf311556806a 100644 (file)
@@ -94,7 +94,7 @@ void Texture3D::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));
        glTexImage3D(target, level, storage_fmt, width, height, depth, 0, comp, type, data);
 
        allocated |= 1<<level;
@@ -121,7 +121,7 @@ void Texture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd, unsi
        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)
                glTextureSubImage3D(id, level, x, y, z, wd, ht, dp, comp, type, data);
        else