Problem loading textures

Started by Rainer, April 20, 2007, 06:35:40

Previous topic - Next topic


I did some random terrain generator:

Now i would need to load a texture, would look much nicer then  ;D

First i tried the Tutorial ond this side (
All i got was:
org.lwjgl.opengl.OpenGLException: Invalid operation (1282)
        at org.lwjgl.opengl.Util.checkGLError(
        at org.lwjgl.opengl.Display.swapBuffers(
        at org.lwjgl.opengl.Display.update(

After this, i tried the NeHe tutorial about loading textures. After changing:
IL.ilGenImages(1, image);

it compiled fine, but when running, no texture is visible on the crate.

Any ideas  ???


hmmm you did the right thing regarding the function (removing the 1) as for the error, try print the path devil is trying to load.


I'm confused.
I tried around with the nehe lesson6, commenting out the loadtexture => everything is fine.
With the loadTexture either the crate is not visible at all or at seemingly at a random greyscale  ???
Same behavior with an impossibl path to the image, so i think it can't be found anyway.
Havent seen this with my previous testing, cause testing with random behavior is a bit difficult  ::)


Ok, NeHe Lesson 6 now running, i needed to specify the working directory in netbeans.

Unfortunately i have the "OpenGLException: Invalid operation (1282)" still when trying to load a Texture like described in the wiki...


New error after Clean and Build:
        at org.lwjgl.devil.IL.ilLoadFromURL(
        at Game.loadTexture(
        at Game.render(
        at Game.main(


I'm confused  ???

The Nehe code works, so i copied the texture loading from the NeHe code into my class and tried to load the texture the same way as Nehe does. This resulted, once again, in an OpenGLException: Invalid operation (1282).

Then, i copied the other texloading code into the nehe code and tried to load, no error, but also no texture, just a white crate...


Problem found, stupid as expected:
Needet to load the texture in the init(), not later in render();  ::)


that's what it looks like now:

now i can begin to deal with the funny thins like collision detection  ::)