LWJGL Forum

Programming => General Java Game Development => Topic started by: manbearpig101 on January 20, 2011, 02:59:10

Title: SlickUtil TextureLoader
Post by: manbearpig101 on January 20, 2011, 02:59:10
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!
Title: Re: SlickUtil TextureLoader
Post by: manbearpig101 on January 20, 2011, 03:53:15
I figured out that doing:

GL11.glEnable(GL11.GL_TEXTURE_2D);   

fixes the problem.

:)