Experience in game pole Programming

Source: Internet
Author: User

Author: Zhu Jincan

Source: http://www.cnblogs.com/clever101

 

Recently, I had to develop the game pole programming for the project, so I would like to make a special summary of the gains.

 

First, test and configure the game rod. In Windows, the control panel has a "game controller" function. You can click it to test and configure the game rod.

 

At the beginning, I searched online for programming materials for the game pole. The information on the internet is concentrated in multimedia joystick functions in winmm. Lib, similar:Use vc5.0Programming the game Rod. However, I tested it and found that using multimedia joystick functions in winmm. lib has some drawbacks, that isMultimedia joystick FunctionsOnly messages with keys 1, 2, 4, and 4 can be obtained, and messages with eight POV direction keys cannot be obtained. For example, (I am using VC 6.0. It is not ruled out that platformsdk is too old, if an error occurs, use winmm of platformsdk of a later version. correct Lib. Thank you !)

 

 I have to find new ones.POVDirection key method. Continue to search, and finally find a referenceDirectinputMethod acquisitionPOVDirection key message:MFCLowerDirectinputImplementationThe method mentioned in is indeed feasible. In additionMicrosoft DirectX SDK (August 2009)Examples of game controllers are also provided.,Specifically$ \ Microsoft DirectX SDK (August 2009) \ samples \ c ++ \ directinput \ joystick, For other versionsMicrosoft DirectX SDKThere should also be. You can refer to the source code.

 

There are so many gains, hoping to be helpful to players who want to program the game pole.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.