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?
This question has been asked just a few hours ago :)
http://lwjgl.org/forum/viewtopic.php?t=827
Chman
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!
As I am the poster of the before mentioned post: how did you solve it? Just by removing the javax.swing code?
To remove all this ugly error code, just use an ImageIO class to load the image instead of a ImageIcon... and it works :)
Chman
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.