General DirectInput Questions (Joystick)

Started by
1 comment, last by Reegan 15 years, 5 months ago
Hi all, thanks for coming :) Question 1: Do i have to create multiple joystick devices for the amount of joysticks that can be used in my game? im fairly new to the joystick thing so, would i have to do this:
IDirectInputDevice8 *m_lpJoystick;

//or this:

IDirectInputDevice8 *m_lpJoystick[4];
Question 2: Also, i would like to have support for Plug 'n' Play, PS3 and Xbox 360 handsets (at the same time) how would i go about this? Is it really difficult to add support for PS3 and Xbox handsets? Thanks for reading :)
Advertisement
its very easy to use an xbox 360 game pad and direct input. you just need to use XInput and that has full support for 360 pad.

hope this helps theres loads of examples to get going with xinput.

not sure about ps3 pad though

edit
oh yeah and for the devices, when using 360 pad I have

XINPUT_STATE gamepad[4];

and then each frame you can use a function something like getPadState(gamepad) in a loop to get the states of them if they are connected.
Ok so i take it i have to create an array of devices for the number joysticks aloud in my game :) thanks, ill wat for a second oppinion though, i also still need to find out about ps3 handset support ;D

This topic is closed to new replies.

Advertisement