LWJGL Forum

Programming => OpenGL => Topic started by: Kova on March 18, 2007, 22:17:42

Title: NeHe Lessons, org.lwjgl.opengl.OpenGLException: Invalid enum (1280)
Post by: Kova on March 18, 2007, 22:17:42
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.
Title: Re: NeHe Lessons, org.lwjgl.opengl.OpenGLException: Invalid enum (1280)
Post by: Fool Running on March 19, 2007, 14:20:12
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
Title: Re: NeHe Lessons, org.lwjgl.opengl.OpenGLException: Invalid enum (1280)
Post by: Kova on March 19, 2007, 15:12:32
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 :)
Title: Re: NeHe Lessons, org.lwjgl.opengl.OpenGLException: Invalid enum (1280)
Post by: raghavan_26 on March 27, 2007, 12:47:04
Hi Kova ,

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

Thanks in advance
raghavan
Title: Re: NeHe Lessons, org.lwjgl.opengl.OpenGLException: Invalid enum (1280)
Post by: Kova on March 27, 2007, 14:15:42
google for "nehe" put his page on top...

http://nehe.gamedev.net/

I didn't download tutorials, I read them online...
Title: Re: NeHe Lessons, org.lwjgl.opengl.OpenGLException: Invalid enum (1280)
Post by: kappa on March 27, 2007, 15:20:48
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.