NeHe Lessons, org.lwjgl.opengl.OpenGLException: Invalid enum (1280)

Started by Kova, March 18, 2007, 22:17:42

Previous topic - Next topic

Kova

Hello.
I'm learning with NeHe tutorials, this is from Lesson 07. When I try to use GL_LINEAR_MIPMAP_NEAREST as GL_TEXTURE_MAG_FILTER, aplication crashes with Exception below. In tutorial MIPMAP is actually used on MIN filter, but does it matter? When I use it on MIN, texture is solid white.

--
org.lwjgl.opengl.OpenGLException: Invalid enum (1280)
   at org.lwjgl.opengl.Util.checkGLError(Util.java:56)
   at org.lwjgl.opengl.Display.swapBuffers(Display.java:555)
   at org.lwjgl.opengl.Display.update(Display.java:571)
   at Lesson07.run(Lesson07.java:82)
   at Lesson07.main(Lesson07.java:72)

--

Also, on Lesson 06, when I load texture using TextureLoader (originaly loaded with DevIL), Texture classes from Kev's space invaders tutorial, the texture is mirrored (rotated 180 around x axis). Anybody knows why?
Thank you.

Fool Running

The mipmap targets can only be used with GL_TEXTURE_MIN_FILTER. There is no meaning to mipmapping a texture that has to be enlarged.
The texture might be solid white because you aren't specifying any mipmaps for the texture. You can build mipmaps for a texture with GLU.gluBuild2DMipmaps().

Most textures seem to be loaded upside down because OpenGL has (0, 0) as the bottom left of the view instead of the upper left. Its possible the TextureLoader flips them to compensate for this, or that the texture coords need to be changed to get it to appear correctly.

Hope that helps ;D
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

Kova

thank you, it seems I haven't studied the tutorials as I should have. I don't remember any notes that it can't be on MAG also, or that you need to create mipmaps manually :)

raghavan_26

Hi Kova ,

can you forward me the link form where you have downloaded nehe tutorials or the zip files atleast

Thanks in advance
raghavan

Kova

google for "nehe" put his page on top...

http://nehe.gamedev.net/

I didn't download tutorials, I read them online...

kappa

grab the nehe tutorials from http://bloody-blades.de/?page_id=3 code is much nicer than the lwjgl ones on the actual nehe pages.