LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: growlieRa on April 20, 2006, 07:40:31

Title: Mouse.setGrabbed trouble
Post by: growlieRa on April 20, 2006, 07:40:31
Hi, i'm having issues with Mouse.setGrabbed.  When I call it from my main thread, the one that does Display.update() and Display.sync, it works fine. When I call Mouse.setGrabbed(true) from a different thread, it acts like the mouse is in fact grabbed(can't click on window buttons), but the cursor is drawn. Obviously there are work-arounds, but is this the intended behavior?
Using windows xp btw.
Title: Mouse.setGrabbed trouble
Post by: Matzon on April 20, 2006, 10:13:02
The intended behaviour is that lwjgl is single threaded. If you are using it in a multithreaded environment results are undefined.

So best way to solve this, is to make sure that the calling thread is the one that created the display.
Title: Mouse.setGrabbed trouble
Post by: growlieRa on April 20, 2006, 18:23:16
That clears things up, thank you for the quick response.