Advertisement

SDL 360 controller

Started by April 26, 2011 01:36 AM
5 comments, last by Wrathnut 13 years, 7 months ago
I have seen some postings that people have been able to get an Xbox 360 controller to sort of work with SDL. I was playing with it tonight but was unable to get SDL to even recognize one was attached. Does anyone know how they got it to be recognized? I downloaded the Windows Xbox 360 controller drivers and it still wasn't being recognized. I was wondering if there is something that you need to do inorder to get it setup.

The code I am using to test it is:


//Check the joysticks
this->mainLog->writeLine(" Checking for Joysticks...");
int num_joy;
num_joy=SDL_NumJoysticks();
if(num_joy > 0){
this->mainLog->writeLine(" Joysticks found..");
for(int i=0;i<num_joy;i++){
this->mainLog->writeLine(SDL_JoystickName(i));
}
}
else{
this->mainLog->writeLine(" No joysticks found..");
}


So far my log files keep reporting that no joysticks were found.

Any help would be appreciated.

Thanks
Are you using a wired 360 controller (the one without a battery pack slot)?

If not, then AFAIK you've got to buy some kind of Microsoft dongle thing to make the wireless 360 controllers work with a PC.
Advertisement

Are you using a wired 360 controller (the one without a battery pack slot)?

If not, then AFAIK you've got to buy some kind of Microsoft dongle thing to make the wireless 360 controllers work with a PC.


I am just using the standard 360 controller with the rechargable battery pack plugged into the usb port on my pc. Do they sell a different controller or something?
In my post "dongle thing" was a link to:http://en.wikipedia....Gaming_Receiver
The forum styles seem to have changed recently so you can't spot hyperlinks any more rolleyes.gif

To use a wireless 360 controller on your PC, you've got to buy a "Wireless Gaming Receiver" (yes, even if you plug it in via USB it still communicates via wireless) sad.gif

There is a different model of 360 controller, which doesn't have a battery pack and has a non-removable USB cable -- this model works on PC without needing the dongle thing.
SDL also doesn't support XInput (the DirectX XInput, not the X11 extension -- btw, why did Microsoft choose to use a name that was already used by a piece of effectively competing software?), so 360 controller support may not work. Someone on the mailing list is in the progress of making a patch for this, but it's for the newer 1.3 and not the outdated 1.2 that nearly everyone's still using.
@Hodgman, the only links in blue are the ones to Intel's new cloth simulation.
To use a wireless 360 controller on your PC, you've got to buy a "Wireless Gaming Receiver" (yes, even if you plug it in via USB it still communicates via wireless) sad.gif
That's not obvious at first because when you plug one into the USB port it automatically installs a driver to use a 'Xbox360 Controller via charge cable(or some similar name)' implying that it should work. Then you have to scour the net to find out what the hell is going on.
Advertisement
Hodgman - Thanks I never noticed the link until you pointed it out. Thanks though that explains everything.

nfries88 - It was my understanding that pretty much only the left and right rumble support was missing from the contorller in the current 1.2 code base. Something I can live with.

Daaark - Yep, that pretty much sums up what happened.

This topic is closed to new replies.

Advertisement