VBGamer |
|
Joystick problems SLotman (0 replies, 0 views) (2000-Aug-30) I am having a few problems trying to set up multiple joystick control under
DX...
let me try to explain what I am going through...
I am planning a local multiplayer game that uses multiple joystick (a
bomberman clone) - I want a 4 player game. I have set up the direct input
object and everything else right as shown in the SDK (except for a callback
function). I created an array of joystick devices, so I could have
joystick(1) as the first joystick and so on until I have initialized all
joysticks plugged into the computer (since I have only one that doesnt make
much differece)
I have notice that when I enable the player to be controlled by joystick,
the game slows down, loosing 20 to 30 fps. Then I figured out the problem I
have is that I am polling the joystick every loop during the game. I know
now I HAVE to create a callback function, so the game runs at full speed (I
hope).The problem I have IS on joystick.poll, since when I disable it everything
fine (and I am the same movement routines I use with keyboard control that
works correctly)
My problem is: since I can have multiple joysticks connected to the
computer, do I have to create a callback function to each one of them? How
could I do it?? Or there is another way? Maybe setting all callbacks to the
same function and retriving which joystick triggered the call? (I think
that is the best one, but have no idea on implementing it at all)
Any help apprecited...
P.S.> Sorry for my baaaaad english 8(
SLotman |