LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Torradin on December 25, 2010, 21:50:13

Title: Problem with LWJGL game on a Mac
Post by: Torradin on December 25, 2010, 21:50:13
I've been developing a game using the LWJGL game library on a PC for a few weeks now. It is a 3D First-Person game. The game is very, very basic, and ran perfectly on my PC. Today, I have bought an iMac running Mac OS X Snow Leopard. I have installed Eclipse IDE, with the LWJGL library, and imported my workspace which I had on my PC. After I go to run the game on my Mac, It runs good, and the mouse works to look around, although I cannot move around with my W, A, S, and D keys, in which I could on my PC. Could someone please help? This is somewhat urgent. Thanks!

If needed, I'll supply the source code.
Title: Re: Problem with LWJGL game on a Mac
Post by: Jens v.P. on January 05, 2011, 11:13:33
Which version of Eclipse are you using on OS X? Are you using Carbon or Cocoa, especially for retrieving the key event? There is a known problem with Carbon applications, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=207298 .

Cheers,
Jens
Title: Re: Problem with LWJGL game on a Mac
Post by: avm1979 on January 08, 2011, 20:48:37
Quote from: Torradin on December 25, 2010, 21:50:13
I've been developing a game using the LWJGL game library on a PC for a few weeks now. It is a 3D First-Person game. The game is very, very basic, and ran perfectly on my PC. Today, I have bought an iMac running Mac OS X Snow Leopard. I have installed Eclipse IDE, with the LWJGL library, and imported my workspace which I had on my PC. After I go to run the game on my Mac, It runs good, and the mouse works to look around, although I cannot move around with my W, A, S, and D keys, in which I could on my PC. Could someone please help? This is somewhat urgent. Thanks!

If needed, I'll supply the source code.

Are you, by chance, launching the game main loop from a swing/awt Button's ActionListener or somesuch?  If you are, that will hang the event processing thread until your game exists, and on a Mac, LWJGL uses the awt keyboard events for input.  If that's the case, just run the game in a new thread.