Mouse.setGrabbed(true) causes NPE on macosx

Started by Notch, April 16, 2005, 16:58:48

Previous topic - Next topic

Notch

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)

lightbringer

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)

Notch

I am, yes, but I'm not calling Display.makeCurrent() before.