Jump to content
  • Advertisement
Sign in to follow this  
blackgame

Joypad control

This topic is 4523 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

hi guys~ i wonder if this is a DirectX question as i think so. i built a simple window program which can only receive keydown actions for now, i'd like it may accept joypad commands(up, down, A and B button etc), i think DirectX may do this but have no idea how to, any help ?

Share this post


Link to post
Share on other sites
Advertisement
tks jollyjeffers.

below is what i found in joystick sample link:

Description
The Joystick sample program obtains and displays joystick data.

Path
Source: (SDK root)\Samples\C++\DirectInput\Joystick
Executable: (SDK root)\Samples\C++\DirectInput\Bin\Joystick.exe

where could i find that source file ? i dont want to download full DirectX SDK if possible, u know its size too large. tks again.

Share this post


Link to post
Share on other sites
Quote:
Original post by blackgame
where could i find that source file ? i dont want to download full DirectX SDK if possible, u know its size too large. tks again.

Nope, you don't get that file unless you get the SDK.

If you're really worried about the download size then you have three options as I see it:

1. Find a friend/colleague with a fast(er) net connection and a CD burner. Be nice to them and ask them to download it for you.

2. Download the October 2005 SDK instead of the December 2005 SDK. The latter has the Direct3D 10 parts included and is nearly twice the size of the former. DInput hasn't changed since DirectX8, so it shouldn't make any difference.

3. Find a book in a library (or buy one!) that includes the SDK and sample code on a CD. As with #2 above, DInput hasn't changed much so it shouldn't matter how old the book is so long as it's within the last 3-4 years.

hth
Jack

Share this post


Link to post
Share on other sites
Alternately, since it sounds like you aren't already using DirectX in your program you might want to check out the Windows Multimedia API for Joysticks. You can more or less just copy and paste the section about using joysticks into your program.

Share this post


Link to post
Share on other sites
tks jollyjeffers, i'll try to find someone with faster connections.

to SiCrane: tks for that, but i get some errors when trying to compile sample code here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_joysetcapture.asp

my VC compiler report errors as below:

main.obj : error LNK2001: unresolved external symbol __imp__joyGetNumDevs@0
Debug/Project1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Project1.exe - 2 error(s), 0 warning(s)


how to fix it pls ?

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
Did you link against Winmm.lib?


i checked VC folders and found both Mmsystem.h and Winmm.lib in include and lib folder. strange it can not be linked properly...

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
Yes, but did you add to the list of libraries to be linked against in your project properties?


wor the prob get sorted ! i'm not using VC for a long time, tks !!!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!