Crash on exit when fullscreen is enabled

Started by elias4444, December 07, 2004, 18:58:32

Previous topic - Next topic

elias4444

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?
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

Chman


elias4444

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!
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com

jorrit5477

As I am the poster of the before mentioned post: how did you solve it? Just by removing the javax.swing code?

Chman

To remove all this ugly error code, just use an ImageIO class to load the image instead of a ImageIcon... and it works :)

Chman

elias4444

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.
=-=-=-=-=-======-=-=-=-=-=-
http://www.tommytwisters.com