Loading Image in JOGL? AUX lib?

How to load image in JOGL to be used in texture mapping?

1 more thing is AUX library supported in JOGL? Coz i want to use the function: auxDIBImageLoad to load the image and use it as texture in my application

thanks

If you look at my jogl port of NeHe example 6, you can see one way of loading a texture.

BUt that sample only loads a .PNG file i want to create a function that loads a .BMP file

Is Aux lib not available in JOGL?

AFAIK AUX is not supported in any form by JOGL. A short quote from OpenGL Technical FAQ:

"2.130 What is the AUX library?

Very important: Don't use AUX. Use GLUT instead.

The AUX library was developed by SGI early in OpenGL's life to ease creation of small OpenGL demonstration programs. It's currently neither supported nor maintained. Developing OpenGL programs using AUX is strongly discouraged. Use the GLUT instead. It's more flexible and powerful and is available on a wide range of platforms."

ps. There’s nothing wrong with PNG (at least when compared to BMP). By using the ImageIO API (introduced in J2SE version 1.4) you can read BMP images as well, allthough this requires you to include an additional JAI library (jai_imageio.jar) with your application.

If you still need some help with the texture loader, I can post a short snippet on the topic here later on…

ah ok
thanks
Can you send /post your sample snippet?

Ok, I’ve uploaded the snippet here:

http://www.g0dmode.com/javastuff/jogl-textureio.zip

The package contains the source for two classes:

  • TextureIO: Used for reading the texture files (and thus creating Texture instances)
  • Texture: Used for initializing the actual texture data and binding it as necessary.

Note: some parts of the code are borrowed from Kevin Glass’ texture loader (license: public domain?).

You can find the version by kevglass here:

http://wiki.java.net/bin/view/Games/TextureLoadingExample

Cheers

License - kevglass special, just take it, I don’t want it. Please. :slight_smile:

Kev

[quote]License - kevglass special, just take it, I don’t want it. Please. :slight_smile:
[/quote]
That’s good to hear. I tend to license my stuff under a “non-nuclear intentions -license” :).

Thanks !!