I've been looking at ways to load data into a game. I even asked a question on stack overflow about reading binary data in a portable manner . The gist of the answer seemed to be that you can use the int types header file to specify an particular integer byte amount, but there's nothing really useful for floats, etc.
I then thought that you could use fixed point, rather than floating point, but I wanted to see how other games did it. Here is one example, a md2 loader: http://tfc.duke.free.fr/old/models/md2.htm . However, it seemed to assume that the size of various types would just work, and that they would be the same on the platform that made the md2, and the one that read it. This seemed to be fairly common in the code that I've seen so far.
So is it really common to just ignore possible different size issues, or have I just been looking at bad (or old) samples? If it's not, could you also demonstrate a better way to do it, or at least link to one?
Thank you.