Skip to main content
gamedev.net
🔒 Locked

Direct Input Help...

Started by RegularKid Oct 21, 2001 at 9:37 PM 6 replies 450+ views
Original Post
RegularKid
RegularKid
Here''s what i''ve done to start my direct input test and for some reason it''s not working. Please tell me what i did wrong. 1. Made sure that c:\mssdk was at the top of the list in both the includes and the libs directories 2. Added dinput.lib to my link settings 3. Here''s my code myInput.cpp: LPDIRECTINPUT lpdi = NULL; void DIInit(void) { // Create the main direct input device DirectInputCreate(hInst,DIRECTINPUT_VERSION,&lpdi,NULL); } void DIKill(void) { // Release the main direct input device if(lpdi) { lpdi->Release(); } } I call these functions from my main program (this code also has a header file associated with it) When I go to compile, it tells me that DirectInputCreate is an undeclared identifier. What am i doing wrong? Thanks!
Oluseyi
Oluseyi
1.) LPDIRECTINPUT8 lpddi; // note the 8!
2.) DirectInput8Create(); // again, note the 8



To you it''s a Bently, to me it''s a blue car...
"Diddy"
P.Diddy
RegularKid
RegularKid
No, I tried that and it still doesn''t work. It keeps telling me that DirectInputCreate() is an undeclared identifier. Thanks though, and sorry about the double post thing (i get better responses that way)
netjockey
netjockey
Try adding dinput8.lib to your project, not dinput.lib!

greetz,
netjockey

Edited by - netjockey on October 22, 2001 6:20:56 AM
RegularKid
RegularKid
No, that still didn''t work. I know that the function DirectInputCreate() exists because when i type it in code, the little VC++ function popup comes up and tells me what parameters i need to pass into the function. But when I go to compile it, it tells me that the DirectInputCreate is an ''undeclared identifier''. But I know for sure that i added dinput.lib to my link settings and that i did #include . What is going on?!
Scarab0
Scarab0
If you''re using the DX8 SDK and want to use DirectInputCreate() which is pre-DX8, then you must do:
#define DIRECTINPUT_VERSION 0x0700
BEFORE the line:
#include
Dirk =[Scarab]= Gerrits
Oluseyi
Oluseyi
Here''s the breakdown. To use DX8, use DirectInput8Create(), LPDIRECTINPUT8, include dinput8.h and link with dinput8.lib. MSVC has no help for these functions/types, but a .chm help file is included in the SDK download.

To use earlier versions of DirectX, drop the 8 and #define DIRECTINPUT_VERSION to the appropriate version (0x0700 for DX7).
RegularKid
RegularKid
Cool! It finally works. Thanks Scarab0.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.