Texture Loader?

Hi All,

I’m currently converting Mighty Bubbles from Java2D to LWJGL and I reused some code of tutorial 104 by kevin Glass. By the way, this tutorial is very good and I recommend it. To load a texture it loads an image from file with the image IO API, converts the image in a format that is compatible with opengl as ByteBuffer and then creates a texture. A lot of processing isn’t? The loader in the tutorial seems to work fine but it works only with a BufferedImage.

My problem is that the tutorial probives a texture loader for bitmaps from standard file formats. What I need is both from standard format and from a custom format for my level file (.fmp). I’ve tried to create a BufferedImage from scratch with a ColorModel, WritableRaster and so on but I don’t have time right now to fully understand how the level loader works since it supports many image formats and other bit shifts that are not really documented (as usual ;-)).

Is there a standard way to load textures with LWJGL without having a dependency on BufferedImage? Does LWJGL provide its own loader? For it just doesn’t make sense if every LWJGL developer uses its own texture loader. In my opinion nn API needs to created and standardized for this purpose.

Thanks for your time!

Jerome

Yes, it’s Devil. See the LWJGL wiki for more information:
http://java-game-lib.sourceforge.net/wiki/tiki-index.php?page=Lesson+6

WiESi

OK thanks! I’ve already know devil from a high perspective but I didn’t know that it supports OpenGL texture convertions and direct raster manipulation. Do you confirm these features?

Yes. But, it does not put the image right when it loads it. You have to do that yourself. ie. If you load an image that saves the data backwards, DevIL does not correct the direction. You have to manually correct/orient the image.