🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Tutorial 6 - Can't load file

Started by
4 comments, last by mattmorten 18 years, 3 months ago
Hey guys, Great tutorials, except, I'm having problems loading the bitmap you guys provide with the demo. I get: Width of mine.bmp: 2147516416 Height of mine.bmp: 16783360 Planes from mine.bmp is not 1: 65535 Bpp from mine.bmp is not 24: 65534 Error reading image data from NeHe.bmp. I'm using the Linux code provided at the end of the tutorial. Any ideas? Thanks
Advertisement
What kind of environment are you compiling in? Naturally I assume Linux, but on an x86 PC or a PPC Mac or what? I'm wondering if there are endian issues, but it's only a guess since I don't have the tutorial code in front of me.
I set the clouds in motion, turn up light and sound...Activate the window, and watch the world go 'round
Aha! I'm compiling on a PPC iBook G5! I never thought of that. I'll have a look at the MacOSX tutorial. Thanks!
Ok, so the OSX tutorial give Objective-C (I wont touch that stuff lol). What sort of thing do I need to do to make mine work? Seek to the end of the file, then work backwards?
Lwo files has this endian problem since the format originally came from the amiga, wich uses the same endian order as macs.
Basically what it means is that the byteorder is reversed, not the bit order.
so a float would use bytes 1234 on a x86 and a mac 4321.
It's totaly anoying.
I might add that i cant exactly tell you if this info will help you solve your problem, it might not even be correct since this is a bit uncharted territory for me.
Well, I've gone and downloaded an open source BMP library which claims it can cope with big-endian and little-endian, and it works like a charm. All research indicates that yes it is a problem with the byte ordering, but with my limitied experience of C++ programming I was unable to solve it myself.

This topic is closed to new replies.

Advertisement