Hello Guest

SlickUtil TextureLoader

  • 1 Replies
  • 5697 Views
SlickUtil TextureLoader
« 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!

Re: SlickUtil TextureLoader
« Reply #1 on: January 20, 2011, 03:53:15 »
I figured out that doing:

GL11.glEnable(GL11.GL_TEXTURE_2D);   

fixes the problem.

:)