X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture3d.cpp;h=a268857d4996cd9bc08d98d9d5c8918bc7d25a3c;hb=7f0e08f04536bf42b8f64e7dff5cc3e18b916c7b;hp=03c58d0afdf05e6273cfbbea2892ea2d7e067ca9;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266;p=libs%2Fgl.git diff --git a/source/core/texture3d.cpp b/source/core/texture3d.cpp index 03c58d0a..a268857d 100644 --- a/source/core/texture3d.cpp +++ b/source/core/texture3d.cpp @@ -36,7 +36,11 @@ Texture3D::Texture3D(): void Texture3D::storage(PixelFormat fmt, unsigned wd, unsigned ht, unsigned dp, unsigned lv) { if(width>0) - throw invalid_operation("Texture3D::storage"); + { + if(fmt!=format || wd!=width || ht!=height || dp!=depth || (lv && lv!=levels)) + throw incompatible_data("Texture3D::storage"); + return; + } if(wd==0 || ht==0 || dp==0) throw invalid_argument("Texture3D::storage"); @@ -94,7 +98,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<