DDS files and S3TC?

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 44 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 44 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?

  1. 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.

Diapolo

I REALLY NEED HELP. Anyone got an idea?

Diapolo