Hi,
I’m new to Monogame, but not to programming.
I’m writing an OpenGL platform game for my 9-year old daughter. It’s coming on well, but I’ve got stuck with game controller support in Windows XP.
The game is being developed on my machine, on Windows 10, and it works well. It detects my 360 Gamepad fine, and will detect and use other generic pads too (one with analogue controls, one without.) However, when I run the game on Windows XP, only the 360 pad is detected and used - the other generic pads are not detected. The IsConnected property is always true (whether there is a pad connected or not) however. Is this a known issue in Monogame, running on Windows XP (OpenGL)?
All I’m doing at this phase is GamePad.GetState(PlayerIndex.One) and running checks against it. Is there anything else I should/could do?
Any input would be really appreciated (pun intended!)
Thanks,
Paul.
(Forgot to mention, Monogame version is 3.4)
I think that’s an OpenGL issue instead of dx11, I think people have reported similar issues, maybe you find an answer there
OK, Thanks. Apologies for not replying sooner.
So I’ve upgraded to Monogame 3.5 and also switched to DirectX. Windows XP doesn’t need to be supported now after I upgraded my daughter’s PC 
I’m thinking of using the Joystick class to basically do the same thing as before but with the ability to detect generic gamepads (only the XBox 360 controller is being detected with the GamePad class in DirectX). I’m guessing the GetState for Joystick is looking for a GUID or something?
I can find very few examples of Joystick.GetState and none detail what the index actually is… How do I get a list of the GUIDs of connected joysticks, if that’s what’s required for the index?
I think joystick support was rather limited in XNA and I don’t think monogame improves on that.
You can probably use a directinput wrapper, like most of the PC ports in the last console generations, where you basically map your inputs to a xbox 360 controller
Otherwise I would google for the issue in relation to XNA
Joystick class is something that didn’t exist in XNA, and is currently only implemented on DesktopGL backend.
I would recommend you use DesktopGL if you want to interact with non Xbox controllers since otherwise you will have to use directinput directly as stated above (MonoGame uses Xinput on Windows DirectX).
Also if your gamepad is not detected by MonoGame DesktopGL backend from development build, you can simply submit a new line of info to the https://github.com/MonoGame/MonoGame/blob/develop/MonoGame.Framework/SDL/gamecontrollerdb.txt which is used for Gamepad detection (you can get the info for it from the Joystick class).
the irony when gamepads are not supported in DesktopGL so he switched to Desktop DX and now you say he should go back hahaha
He used the old version of MG which used OpenTK… we ditched that in favor of SDL on develop branch which works so much better.
That’s true, it was OpenTK. Unrelated, but profiling had better GPU performance under DX which was another reason to change from OpenGL. I will take your advice and swap to DesktopGL and see if that helps with the controllers.
Thanks for the help guys, it’s been valuable.