| 232 | } |
| 233 | |
| 234 | U8* GFXGLTextureObject::getTextureData( U32 mip ) |
| 235 | { |
| 236 | AssertFatal( mMipLevels, ""); |
| 237 | mip = (mip < mMipLevels) ? mip : 0; |
| 238 | |
| 239 | const U32 dataSize = ImageUtil::isCompressedFormat(mFormat) |
| 240 | ? getCompressedSurfaceSize( mFormat, mTextureSize.x, mTextureSize.y, mip ) |
| 241 | : (mTextureSize.x >> mip) * (mTextureSize.y >> mip) * mBytesPerTexel; |
| 242 | |
| 243 | U8* data = new U8[dataSize]; |
| 244 | PRESERVE_TEXTURE(mBinding); |
| 245 | glBindTexture(mBinding, mHandle); |
| 246 | |
| 247 | if( ImageUtil::isCompressedFormat(mFormat) ) |
| 248 | glGetCompressedTexImage( mBinding, mip, data ); |
| 249 | else |
| 250 | glGetTexImage(mBinding, mip, GFXGLTextureFormat[mFormat], GFXGLTextureType[mFormat], data); |
| 251 | return data; |
| 252 | } |
| 253 | |
| 254 | void GFXGLTextureObject::copyIntoCache() |
| 255 | { |
nothing calls this directly
no test coverage detected