View Full Version : DDS files and S3TC?

08-02-2000, 09:58 AM
Hi @ll!

I have got a few questions related to DDS files (I use the format because of S3TC)!

1. How can I get the EXACT size of the buffer in which I want store the texture data of the DDS file? I currently use the following code:

if(ddsd.dwMipMapCount > 1)
int TempWidth = ddsd.dwWidth;
int TempHeight = ddsd.dwHeight;

for(int i = 0; i < (int)ddsd.dwMipMapCount; i++)
BufSize += ceil(TempWidth / 4) * ceil(TempHeight / 4) * TempTexture.BlockSize;

TempWidth >>= 1;
TempHeight >>= 1;

But now the problem, if there are mipmaps smaller than 4*4 pixels the result of ceil(TempWidth / 4) * ceil(TempHeight / 4) * TempTexture.BlockSize is zero. I know that I have to handle all mipmaps smaller than 4*4 with S3TC as 8 Byte blocks (when using them as OGL textures), but I canīt read them in as 8 Byte blocks, or? Anyone got an idea for me?

2. Where can I get the MS Tool for creating DDS files? I know itīs in the DX SDK, but I donīt want to download or order the SDK.


08-04-2000, 05:09 PM
I REALLY NEED HELP. Anyone got an idea?