LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Notch on April 16, 2005, 16:58:48

Title: Mouse.setGrabbed(true) causes NPE on macosx
Post by: Notch on April 16, 2005, 16:58:48
My code:
       Mouse.create();
       Mouse.setGrabbed(true);


The exception as reported over irc:
java.lang.NullPointerException
 at org.lwjgl.opengl.MacOSXDisplay.warpCursor(MacOSXDisplay.java:224)
 at org.lwjgl.opengl.MacOSXDisplay.grabMouse(MacOSXDisplay.java:281)
 at org.lwjgl.input.Mouse.setGrabbed(Mouse.java:514)
 at com.mojang.wom.WrathOfMagranon.b(SourceFile:162)
Title: Mouse.setGrabbed(true) causes NPE on macosx
Post by: lightbringer on April 17, 2005, 14:56:01
Maybe this is trivial, but are you sure you're calling Display.create() before this?
(Not too apparent from the exception, but if that's not the case then frame.bounds would be null in display)
Title: Mouse.setGrabbed(true) causes NPE on macosx
Post by: Notch on April 17, 2005, 15:10:33
I am, yes, but I'm not calling Display.makeCurrent() before.