I'm using JRuby with LibGDX and it's been going quite swimmingly, save for a crash I experience every time I try to use the controllers extension.

Here's a basic rundown:

  1. I've required all the related jars (gdx-controllers.jar, gdx-controllers-desktop.jar, and gdx-controllers-desktop-natives.jar).
  2. I've imported the controllers package via import "com.badlogic.gdx.controllers".
  3. I call Controllers.controllers, which goes to the getControllers method.
  4. My game crashes with this error:

    libc++abi.dylib: terminating with uncaught exception of type OIS::Exception: CocoaInputManager::_parseConfigSettings >> Unable to find a window or event target

I think the error is due to a lack of a view being passed to OIS library (here's an online view of a related source).

How do I prevent the controllers extension from crashing my game? More importantly, how do I make it work? :)

  • \$\begingroup\$ When do you call that _intialize function? If you call it before the Gdx is done loading itself, then things will break. For example, if you create and pass your InputManager to your game constructor, that would be too early. It would be safe to call it in the various platforms' OnCreate methods. \$\endgroup\$ – Seth Battin Jan 4 '14 at 7:19
  • \$\begingroup\$ I'm calling this much after Gdx is available. I'm calling it after I'm already rendering textures, etc. \$\endgroup\$ – Evan Walsh Jan 4 '14 at 19:36
  • \$\begingroup\$ Did you figure this out? \$\endgroup\$ – ashes999 May 8 '14 at 3:47
  • \$\begingroup\$ @ashes999 Unfortunately, no. I think it may be something wrong with the natives being loaded, though. \$\endgroup\$ – Evan Walsh May 8 '14 at 21:13
  • 3
    \$\begingroup\$ This question appears to be off-topic because it is about a library bug best addressed by its developers. \$\endgroup\$ – Anko Jul 8 '14 at 10:15