X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Ftexture1d.cpp;h=d472527c92322f4d05b0fe39640f7f91905133a9;hb=2d3113a7dbbe4be2f1d1e8980c1c4e42175163da;hp=742857be725b4ed205b369c43d823f5b0812af14;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266;p=libs%2Fgl.git diff --git a/source/core/texture1d.cpp b/source/core/texture1d.cpp index 742857be..d472527c 100644 --- a/source/core/texture1d.cpp +++ b/source/core/texture1d.cpp @@ -22,7 +22,11 @@ Texture1D::Texture1D(): void Texture1D::storage(PixelFormat fmt, unsigned wd, unsigned lv) { if(width>0) - throw invalid_operation("Texture1D::storage"); + { + if(fmt!=format || wd!=width || (lv && lv!=levels)) + throw incompatible_data("Texture1D::storage"); + return; + } if(wd==0) throw invalid_argument("Texture1D::storage"); @@ -75,7 +79,7 @@ void Texture1D::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)); glTexImage1D(target, level, storage_fmt, w, 0, comp, type, data); allocated |= 1<