A question about loading textures, with Slick-Util and without

Started by CodeBunny, March 29, 2011, 17:22:34

Previous topic - Next topic

CodeBunny

As my game engine is (finally) approaching something close to finished, I've been considering how I manage my textures. Right now, I use the Slick methods, but I'm not sure that's a good thing.

First of all, Slick-Util texture loading seems to limit me to POT textures, but since I'm concerned with 2D graphics of any size, that means that I'm often being inefficient with texture memory. I've heard that NPOT textures are a little slower, but the higher efficiency seems worth it, especially because 2D rendering isn't that intensive anyway.

Secondly, Slick-Util apparently uses JavaIO. Not 100% sure, but that sounds inefficient - Java loads the image initially, and then the Slick classes convert it and pass it to OpenGL. Sure, it's easy, but it doesn't sound like the best thing in the world.

I'm perfectly willing to work on these problems by myself, but it really seems like LWJGL needs its own, built-in texture loading methods (for both POT and NPOT textures, I would venture). Matthias apparently began something of the sort with PNGDecoder; earlier I didn't use it because I wanted to support multiple image formats. However, it's the commonsense first step.

All in all, this particular feature of LWJGL, loading textures from images - something that basically EVERY game will do, 2D or 3D - is a high necessity, and the fact that LWJGL delegates it to a separate package entirely seems more than a little odd. If the Slick-util methods are the optimal solution, why aren't they included in the base package? If not, why isn't there a different official functionality?