SlickUtil TextureLoader

Started by manbearpig101, January 20, 2011, 02:59:10

Previous topic - Next topic

manbearpig101

Everytime I load a new texture it doesn't work.

Not working code:

this.texture = TextureLoader.getTexture(
            location.substring(location.indexOf(".") + 1, location.length()),
            new FileInputStream(location));

Working code:
this.texture = TextureLoader.getTexture(
            location.substring(location.indexOf(".") + 1, location.length()),
            new FileInputStream(location));
TextureLoader.getTexture(
            location.substring(location.indexOf(".") + 1, location.length()),
            new FileInputStream(location));

The new textures that are returned from TextureLoader don't work, but the preceding ones do work. Why is this?
How to fix?

I don't know if this is the correct section, but please help!

Thanks!

manbearpig101

I figured out that doing:

GL11.glEnable(GL11.GL_TEXTURE_2D);   

fixes the problem.

:)