Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
I have a program capable of rendering 3D graphics using Direct3D11 and it is currently compatible with two different texture formats, TGA and DDS. The code to read and load a TGA texture in memory I’m using was from Rastertek tutorials here and it handle TGA textures which are upside down by reading their bytes backwards, but the code to read and load a DDS texture I’m using is just D3DX11CreateShaderResourcesViewFromFile function from D3DX11tex.h, and it was good enough for me until a while ago, but now I’m facing a problem as some of DDS textures I want to use are upside down in a similar way to the TGA textures, so I need somehow a code where I can control how it reads the texture so I can modify it to read the DDS texture’s bytes backwards. I’ve read this article from Microsft, but even their simplest code is far more complex than the code from Rastertek to TGA files, as I didn’t found anything simpler I’m here asking if someone can explain to me at least how they work. What I ‘think’ I understand about TGA’s data it that it’s first 18 bytes are their header and the rest is 4 bytes for each pixel(in a RGBA style), but I really don’t understand how DDS works.