LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: jorrit5477 on December 06, 2004, 19:04:31

Title: Nehe lesson problem
Post by: jorrit5477 on December 06, 2004, 19:04:31
Hello,

I have just started with opengl and stumbled on this library, so I am working my way through the Nehe tutorials and the ports made for lwjgl (many thanks by the way! Both for lwjgl and for the tuts.)
But in the ports I got a problem. In lesson 6 a texture is loaded using awt/swing. Everything runs fine in windowed mode, but when I run it in fullscreen and I close the app, I get the following error:
Quote
D:\GameDevel\Java\NeHeGLLessons\Lesson06\Lesson06>java Lesson06 fullscreen
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
       at sun.awt.Win32GraphicsEnvironment.displayChanged(Unknown Source)
       at sun.awt.windows.WToolkit$4.run(Unknown Source)
       at java.awt.event.InvocationEvent.dispatch(Unknown Source)
       at java.awt.EventQueue.dispatchEvent(Unknown Source)
       at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

       at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.run(Unknown Source)

D:\GameDevel\Java\NeHeGLLessons\Lesson06\Lesson06>

Since I am not a Java guru I am wondering why this happenes and what (though it seems to me the awt thread is not properly closed)? If I implement the code for getting the image from http://lwjgl.org/forum/viewtopic.php?t=640&highlight=nehe+texture instead of Image image = (new javax.swing.ImageIcon(path)).getImage();, so not using swing everything goes fine.
I am using JDK1.5.0 with lwjgl0.93 on an Windows XP machine.

Hope that someone can help me out on this one.

Regards,
Jorrit
Title: Nehe lesson problem
Post by: Chman on December 07, 2004, 08:56:35
Well, if you're using my tutorials on www.shakebox.org which seems to be the case, it's a weird bug that come with Java 1.5. I must update the tutorials that use this texture loading method...

If you want another way to load textures, look at the DevIL demo :)

Chman
Title: Nehe lesson problem
Post by: jorrit5477 on December 07, 2004, 14:34:57
Thanks for the reply. I have to admit I haven't tried to compile it with an older jsdk (I only have 1.4.2_05 and 1.5.0 here), but I'll have a check.
The ports I use are from Mark Bernard, but I'll have a look at the ones on your site. The seem to be quite promising to me, but still have a long way to go...

Just did a check with 1.4.2_05 and no problem... have to figure out why this happens in 1.5.0...