X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture2d.cpp;h=973afebfcf277b75d217e2d0262e83846e06e41a;hb=47af19a447e6c13257ca2d0aef606ea45f8a0d98;hp=8c8ad3784e4a0a32faad55b49a25dca54fd9c2fb;hpb=edd2a01b3c696df8630ac6a97e9b55a95fe7e112;p=libs%2Fgl.git diff --git a/source/texture2d.cpp b/source/texture2d.cpp index 8c8ad378..973afebf 100644 --- a/source/texture2d.cpp +++ b/source/texture2d.cpp @@ -1,5 +1,7 @@ +#include #include "bindable.h" #include "error.h" +#include "pixelstore.h" #include "texture2d.h" using namespace std; @@ -20,6 +22,7 @@ void Texture2D::storage(PixelFormat fmt, unsigned wd, unsigned ht) throw invalid_operation("Texture2D::storage"); if(wd==0 || ht==0) throw invalid_argument("Texture2D::storage"); + require_pixelformat(fmt); ifmt = fmt; width = wd; @@ -43,7 +46,7 @@ void Texture2D::image(unsigned level, PixelFormat fmt, DataType type, const void unsigned h = height; get_level_size(level, w, h); - Bind _bind(this, true); + BindRestore _bind(this); glTexImage2D(target, level, ifmt, w, h, 0, fmt, type, data); allocated |= 1<