X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Ftexturecube.cpp;h=743eb986247eb95318c98490179b3fdb95683980;hb=4a6c595b4d954b6cf69c6388a43b2b66f84d8c0a;hp=37390a853612523e503889230f030f2a70d2b73d;hpb=7d7a8f9e77a526fd5f2920b9005805e56a4b686c;p=libs%2Fgl.git diff --git a/source/texturecube.cpp b/source/texturecube.cpp index 37390a85..743eb986 100644 --- a/source/texturecube.cpp +++ b/source/texturecube.cpp @@ -47,8 +47,10 @@ void TextureCube::allocate(unsigned level) if(allocated&(1<(img.get_data()); + unsigned face_size = img.get_stride()*size; + for(unsigned i=0; i<6; ++i) + image(enumerate_faces(i), 0, fmt, UNSIGNED_BYTE, cdata+i*face_size); +} + unsigned TextureCube::get_level_size(unsigned level) { return size>>level;