BMP files
First problem was no big deal. The data was in BGR format, had to swap it.
My OpenGL just puts the texture on upside down so I don't have to flip it.
Things work fine as long as each scanline matches up with DWORD packing (8, 16, 32, but for some reason not 24). Here's the psuedocode for trying to remove the padding.
if( width * 3 % 4) //remainder == padding
fileRead( dummyData, 4 - (width * 3 % 4))
Anyone have any input? As far as I can tell, 24bit BMPs don't use compression, am I right?
I use a loop like
for(int Y = 0; Y < BMPHeight; Y++)
{
for(X = 0; X < Width; X++)
{
for (y = 1; y < 4; y++)
{
//Load stuff
}
}
for(X = 0; X < Width % 4; X++)
{
//Load Stuff (same as above, should be)
}
}
This is saver as your method, because in your method you will always end up with a value in dummydata
------------------
Dance with me......
I use Visual Basic and can program DirectX etc. so I know a fair bit about programming.
Can anyone explain how they are stored, and/or give me a demo that shows how to create bmp files.
Thanks
Freeride Designs
for(i = 0; i < height; j++) { for(j = 0); j < width; j++) { ReadRGBtriple(...) } if( width * 3 % 4) //remainder == padding fileRead( dummyData, 4 - (width * 3 % 4)) }
I did this late last night. I was probably just doing something stupid. Just saw this thread and brought it up. Things are dead here at work and it's not late enough to sneak out for that four day Thanksgiving weekend.