View Full Version : How to implement Joystick Support
06-11-2001, 01:48 PM
I was working on a flight simulator. Does anybody know hoe to implement joystick support? Is there anyway to do it through Direct Input or Windows Programming? http://www.opengl.org/discussion_boards/ubb/smile.gif
You asked 2 questions... here are the answers:
1: Yes, I know.
2: Yes, there is.
Gee, how helpful, rts. http://www.opengl.org/discussion_boards/ubb/rolleyes.gif
Acer, look in the documentation for a function called joyGetPos. It's probably the easiest way to quickly get joystick input from Windows.
06-11-2001, 03:47 PM
If you're doing it for a game or a demo you should probably use DirectInput. It's faster than GDI and takes advantage of any hardward accelleration present.
06-11-2001, 06:06 PM
Thanx for the posts. I know directX pretty well or at least Direct Audio and Direct3d. I just have to learn Direct Input. I don't think I will be using windows for it. Anyway I have an awesome flight simulator I am working on. Your moving through the sky and you have a burst of flame coming out the back of the plane. As soon as I add a menu and joystick support, I'll add it to my webpage and you guys( and girls) can check it out.
06-11-2001, 09:44 PM
Wasn't there a tutoriol on DirectInput at NeHe's site?
I think rts's answer length was partly due to the fact that Joystick support has NOTHING to do with OpenGL.... There are game development discussion forums around there for that type of question ! http://www.opengl.org/discussion_boards/ubb/wink.gif
I think rts' answer was very apt and to the point. =)
06-12-2001, 05:37 AM
Everything you need can be found at (http://codeguru.earthweb.com/directx/index.shtml). In particular, look at the third box of links labeled "DirectInput". Jason Brooks has created three classes for DirectInput control ... One for keyboard input, one for mouse input, and http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif one for Joystick input.
Jason did a great job with these classes and I rely on them every day. Send him email if you like it.
06-13-2001, 11:05 AM
Actually, if you are looking toward making your program platform independent, you might want to consider SDL (http://www.libsdl.org). It's simple to use, and there are even examples to get you started.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.