Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Programming Talk / C++ / C# - DirectInput Joystick error.

Author
Message
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 11th Apr 2007 05:50
I've tried to add a Joystick to my framework that I made from Jonathan's book and everything compiled and all but I have a problem creating the device for the joystick. Here is my code for the DXINPUT.h file.



hope this helps you answer my question.

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 11th Apr 2007 12:39
nice idea, but joysticks are different, because you only have one keyboard or mouse attached at a time (i know you can attach more than one, but they are all treated as one by directx) it means that it knows what it is looking for; with joysticks you can have many connected at the same time so people can play against each other so you have to enumerate them, so you can work out how many are attached and what you are going to do with them

i don't have an exampple to hand but from what i remember you have to use a callback. If you look in the directx sdk documentation, it has a tutorial on how to get it all set up and working


amd athlon xp 2600+,1280mb,FX 5200 128mb,200gb & 120gb,xp pro sp2
Lover of games
20
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 11th Apr 2007 15:07
thanks, I tried that and it worked but for some reason when I try to do if(Joybutton(DIJOFS_BUTTON0)) player_ship.x += player_ship.movex, it doesn't work. I'm polling both the Keyboard and the Joystick, is that why it's not working?

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
FrEaK_sK8
19
Years of Service
User Offline
Joined: 11th Mar 2006
Location: errr
Posted: 30th Apr 2007 12:45
My source code on how to programm joysticks :


Login to post a reply

Server time is: 2025-05-22 03:13:47
Your offset time is: 2025-05-22 03:13:47