.bmp files in Unix

Does Unix environment, specifically netBSD, support .bmp files? If I were to write some code on my PC with Windows 2000 loading a .bmp, would it work on Unix?

What library are you using to load in the .bmp? Is that library available on NetBSD?

If you write the BMP loader yourself yes, but if it is someone else loader would have to check it for windows only code.

It is best to use TGA format, since it is supported by both. Also TGA gives you alpha channel support.

Originally posted by Texture maniac:
Does Unix environment, specifically netBSD, support .bmp files? If I were to write some code on my PC with Windows 2000 loading a .bmp, would it work on Unix?

I just went through this with the .tga loader from nehe’s web site.

It wouldn’t work on a Sun machine because Sun uses a “big endian” architecture and .tga’s are saved as “little endian - read X86”.

jpummill

And what are these .ppm files? Why can’t I view them on my PC? Will a .ppm file loader on a PC work on Unix? Why did the OpenGL guys make it so hard to load textures?

Ok, I loaded a texture from a .ppm and was able to display it. Now managing multiple textures…

Open gl doesn’t make loading a texture hard! You can view ppm on a pc if you have a pc ppm image viewer.
Load multiple ppm’s for multiple textures!

You can’t really say that a well-known image format is only supported on <insert desired OSes here>. If the spec for the image is known (as it is for BMP, TGA, etc.), it’s possible to write a loader for ANY os. If you run into the case where the image is stored as litte-endian, but your architecture is big-endian (or the other way around), well… just flip the bytes yourself when you load it in or save it in code .

[This message has been edited by Deiussum (edited 12-02-2002).]

Well, you will always run into compatilbility issues when you are reading information on different architectures.
One reads the bits in the opposite direction from the other…
The way to do this is to simply have an if defined statement like
#ifdef WIN32
{
load little endian.
}
#else
{
load big endian.
}

This is only an example.

Here is a good link. http://www.cs.umass.edu/~verts/cs32/endian.html

[This message has been edited by mancha (edited 12-02-2002).]