Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 9 of 9

Thread: .bmp files in Unix

  1. #1
    Guest

    .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?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Mar 2000
    Location
    east norwalk, ct, usa
    Posts
    184

    Re: .bmp files in Unix

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

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,096

    Re: .bmp files in Unix

    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?

  4. #4
    Intern Contributor
    Join Date
    Dec 2001
    Posts
    93

    Re: .bmp files in 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

  5. #5
    Guest

    Re: .bmp files in Unix

    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?

  6. #6
    Guest

    Re: .bmp files in Unix

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

  7. #7
    Advanced Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    668

    Re: .bmp files in Unix

    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!

  8. #8
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,797

    Re: .bmp files in Unix

    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).]
    Deiussum
    Software Engineer and OpenGL enthusiast

  9. #9
    Member Regular Contributor
    Join Date
    Jan 2002
    Posts
    296

    Re: .bmp files in Unix

    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).]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •