CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2008
    Posts
    47

    Using DirectInput

    Hi,

    I am looking for an easy tutorial on how to read input out of a Joystick or Gamepad with DirectX's DirectInput.

    I have found a code example in MSDN but it has got a huge MFC overhead that I don't want to know about.

    Anybody knows a good site where I could start ?

    Thank you very much.
    Visual Studio 2005 Professional

  2. #2
    Join Date
    Feb 2008
    Posts
    47

    Using DirectInput

    Nobody's got any links or ideas where I could start ?

    Thank you
    Visual Studio 2005 Professional

  3. #3
    Join Date
    Apr 2004
    Location
    England, Europe
    Posts
    2,492

    Re: Using DirectInput

    Have you looked at the samples which are installed with the DirectX SDK?

    They don't use MFC now, do they?
    My hobby projects:
    www.rclsoftware.org.uk

  4. #4
    Join Date
    Dec 2003
    Location
    Syracuse, NY
    Posts
    400

    Re: Using DirectInput

    In the DirectX SDK documentation, they have a tutorial on using the joystick, and no MFC is in there.
    "Windows programming is like going to the dentist: You know it's good for you, but no one likes doing it."
    - Andre LaMothe

    DLL For Beginners(UPDATED)
    Please use CODE tags
    Rate me if I've helped.

  5. #5
    Join Date
    Feb 2008
    Posts
    47

    Re: Using DirectInput

    I don't know if its MFC but there is a GUI in there so I don't see clearly the DirectInput code.
    Visual Studio 2005 Professional

  6. #6
    Join Date
    Dec 2003
    Location
    Syracuse, NY
    Posts
    400

    Re: Using DirectInput

    The sample isn't MFC. Its just calling a dialog box to test out the joystick.

    Look through the code and pay attention more specifically to the DirectX functions they define: InitDirectInput, EnumJoysticksCallback, UpdateInputState, etc...
    It is commented fairly well to explain what they are doing.
    "Windows programming is like going to the dentist: You know it's good for you, but no one likes doing it."
    - Andre LaMothe

    DLL For Beginners(UPDATED)
    Please use CODE tags
    Rate me if I've helped.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured