LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: elias4444 on December 07, 2004, 18:58:32

Title: Crash on exit when fullscreen is enabled
Post by: elias4444 on December 07, 2004, 18:58:32
Here's an odd one that I was wondering if someone could solve for me:

If I only do windowed mode, everything works fine. But if I set Display.setFullscreen(true), then when I exit the game, I get:

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)


Any ideas? Am I missing something?
Title: Crash on exit when fullscreen is enabled
Post by: Chman on December 07, 2004, 19:35:14
This question  has been asked just a few hours ago :)
http://lwjgl.org/forum/viewtopic.php?t=827

Chman
Title: Crash on exit when fullscreen is enabled
Post by: elias4444 on December 07, 2004, 22:54:54
Yep. Sure enough, in my haste to port everything over to OpenGL, I left a few calls to the swing API in my code. Once those were gone, the error went away.

Thanks!
Title: Crash on exit when fullscreen is enabled
Post by: jorrit5477 on December 08, 2004, 04:51:47
As I am the poster of the before mentioned post: how did you solve it? Just by removing the javax.swing code?
Title: Crash on exit when fullscreen is enabled
Post by: Chman on December 08, 2004, 11:33:11
To remove all this ugly error code, just use an ImageIO class to load the image instead of a ImageIcon... and it works :)

Chman
Title: Crash on exit when fullscreen is enabled
Post by: elias4444 on December 08, 2004, 17:30:41
The trick for me wasn't in the texture loading (I was already doing that without swing), but I had to COMPLETELY remove ALL instances of imageicon throughout my program. Once that was done, it worked without the error.