GLFW: Extremely slow due to joystick/gamepad issue

Monkey Forums/Monkey Bug Reports/GLFW: Extremely slow due to joystick/gamepad issue

Michael Flad(Posted 2013) [#1]
I just copy/paste my post in a thread in the GLFW subforum:
----
I just had the same problem while I just wanted to see what has been going on on Monkey since it's release (bought it back then, but haven't done any coding using it).

Luckily I had a very old version installed (31) gave it a try and it run fullspeed so I was able to locate the issue :)

It's the joystick/gamepad support - in my case I do have a wireless adapter for the Xbox 360 gamepad. As long as my gamepad isn't connected the glfw target is unusable slow but if I switch on the gamepad it works without an issue.
Unplugging the wireless adapter doesn't help, so the only solution is to switch on my gamepad.

So my guess is, if you used a joystick/gamepad at any time in the past, for whatever reason, Monkey (or the library Monkey uses to handle the joystick input) keeps trying to access/init/connect the joystick/gamepad and this probably timeouts after a few hundret milliseconds each frame. Well, that's at least my guess but I'm quite sure that's a pretty good shot at it.

Unfortunately I don't have a clue about the build backends so I have no idea how this could be fixed, but maybe someone who does, could have a look at the issue.


Michael Flad(Posted 2013) [#2]
Ok, this was easier than I expected (took me longer to find the bug than to find a workaround ;-))

Add these lines after mouseY=y; in gxtkInput::BeginUpdate() in the file mojo.glfw.cpp (in modules/mojo/native)

if( glfwGetJoystickParam( GLFW_JOYSTICK_1, GLFW_PRESENT ) == GL_FALSE )
{
return;
}

This is just a quick fix, I don't know if the state data of the buttons/axis should be reset to some default values if the joystick isn't present.
So just use this as a workaround until it's fixed in an official release.


emar(Posted 2015) [#3]
*nevermind*

answered here

http://www.monkey-x.com/Community/posts.php?topic=10160


Neuro(Posted 2015) [#4]
Also : http://www.monkey-x.com/Community/posts.php?topic=9923