Thread: DirectInput

  1. #1
    Registered User
    Join Date
    May 2005
    Posts
    207

    DirectInput

    I'm trying to use DirectInput in my program and was basically wondering where/how do I start? I've found some tutorials but at this point all I really want to do is play with one input device at a time. Most tutorials start with a minimum of mouse/keyboard.

    Also, I'm using the DirectX 9 SDK and was wondering if there would be any kind of conflicts if I mixed different versions of DirectX in my program (ie: DirectInput 9, DirectDraw 7, etc)?

    mw
    Blucast Corporation

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    why would you have different versions of the SDK on your computer? I hope you installed them in different directories so that only one version can be used for any given program.

  3. #3
    Registered User
    Join Date
    May 2005
    Posts
    207
    Never mind. I found my answer about version compatibility.

    Anyway, what about the DirectInput tutorials? There is not a single tutorial I've found that starts at the beginning of the program and illustrates how to setup a single input device (everything shows you how to setup multiple devices and doesn't show you includes, etc).

    mw
    Blucast Corporation

  4. #4
    Registered User
    Join Date
    May 2005
    Posts
    207
    Ok, I think this is starting to sink in a little.

    I'm using the DirectInput8Create function:

    Code:
    int My_Direct_Input (void)
    {
         FILE *fp = fopen ("initialize_report.txt", "a");
    
         if (!(DirectInput8Create (hInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void **) &m_pDirectInput, NULL)))
         {
              fprintf (fp, "\n\nDirectInput initialization: FAILED");
              Direct_flag = 0;
         }
         else
         {
              (insert initialization code here)
         }
    }
    The error I'm getting is:
    'DirectInput8Create' undefined; assuming extern returning int

    I have dinput.h in my includes and dinput.lib in my library modules, so I'm really not sure why this is undefined.

    Does anyone know why I'm getting this error?

    mw
    Blucast Corporation

  5. #5
    Registered User
    Join Date
    May 2005
    Posts
    207
    Ok, I've found out why I couldn't get it to compile:

    MSVC++ ver 6.0 isn't supported by any SDKs effective 12/04.

    In order to use DirectX ver 9 with it, you have to use the 10/04 release of DirectX:

    http://www.microsoft.com/downloads/d...DisplayLang=en

    mw
    Last edited by Lionmane; 11-13-2005 at 01:01 AM.
    Blucast Corporation

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectInput and Dev-C++
    By Niara in forum Game Programming
    Replies: 2
    Last Post: 03-11-2005, 10:20 AM
  2. DirectInput woes again....
    By VirtualAce in forum Game Programming
    Replies: 4
    Last Post: 05-25-2004, 03:02 PM
  3. DirectInput or WM_KEYDOWN question
    By Mecnels in forum Game Programming
    Replies: 4
    Last Post: 03-18-2003, 06:45 AM
  4. My DirectInput tutorial....
    By jdinger in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 06-18-2002, 11:32 PM
  5. DirectInput lost with Alt-Tab
    By jdinger in forum Game Programming
    Replies: 2
    Last Post: 05-11-2002, 11:23 PM