Sign in to follow this  

Gamepad support

This topic is 4205 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I have just bought a nice new Logitech Gamepad for my PC which so far I have tried on Sega Sonic Adventure DX. Does anyone know how where to find some information about getting input from a gamepad device in a C++ Win32 type game? I am using OpenGL at the moment not DirectX mainly because it seems a lot easier to use. I want to support gamepads in my future games and game engine since I think this will make them more fun to play and give them an extra edge.

Share this post


Link to post
Share on other sites
Even though you're using OpenGL to render your program's graphics, you can still use DirectInput to read joystick/mice/keyboard input.

DirectInput can be used without any other part of DirectX.

Of course, DirectInput has been depreciated by microsoft, in favor of RawInput, but I know nothing about it yet.



Share this post


Link to post
Share on other sites
Search MSDN for the joyGetPosEx function. There are of course other ways of doing this (such as through DirectX I think), but this is pretty simple with this function I think...

Share this post


Link to post
Share on other sites
Thanks, I've just seen the "joySetCapture" functions from Win32 which seem to be just the job (if they work). I missed them before because I was searching for "gamepad" instead of "joystick".

Now I just need to find out how to implement the extra buttons that my gamepad has the Win32 doesn't seem to support...



[Edited by - paulbird on June 10, 2006 6:15:15 PM]

Share this post


Link to post
Share on other sites

This topic is 4205 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this