X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Ftexturecube.cpp;h=db679cf9e1259cb4feb0e087c0f3e066c40921c3;hp=833ef28f0ebd78add08ccfae4c8555df87dff288;hb=4b4d2a48048268d2ad48bafbce8647af8088573f;hpb=b2c8b2238877f76cdea184cca70336b15ddb78d9 diff --git a/source/texturecube.cpp b/source/texturecube.cpp index 833ef28f..db679cf9 100644 --- a/source/texturecube.cpp +++ b/source/texturecube.cpp @@ -45,7 +45,6 @@ unsigned TextureCube::orientations[12] = TextureCube::TextureCube(): Texture(GL_TEXTURE_CUBE_MAP), - ifmt(RGB), size(0), allocated(0) { @@ -59,11 +58,7 @@ void TextureCube::storage(PixelFormat fmt, unsigned sz) if(sz==0) throw invalid_argument("TextureCube::storage"); - if(MSP_sized_internal_formats) - fmt = get_sized_pixelformat(fmt); - require_pixelformat(fmt); - - ifmt = fmt; + set_internal_format(fmt); size = sz; } @@ -101,7 +96,7 @@ void TextureCube::image(TextureCubeFace face, unsigned level, PixelFormat fmt, D return sub_image(face, level, 0, 0, s, s, fmt, type, data); BindRestore _bind(this); - glTexImage2D(face, level, ifmt, s, s, 0, fmt, type, data); + glTexImage2D(face, level, ifmt, s, s, 0, get_upload_format(fmt), type, data); // XXX Allocation should be tracked per-face, but we'll run out of bits allocated |= 1<