This is stupid.
MSVC tells me this:
error C2065: 'DirectInputCreate' : undeclared identifier
and yet I've included dinput.h and dinput.lib in my project. What the heck is going on? Starting to tick me off a bit here.
This is stupid.
MSVC tells me this:
error C2065: 'DirectInputCreate' : undeclared identifier
and yet I've included dinput.h and dinput.lib in my project. What the heck is going on? Starting to tick me off a bit here.
#define DIRECTINPUT_VERSION 0x0700
Or use DirectInput8Create
No, it says that DirectInputCreate is unidentified. I took out the #include <dinput.h> and then it said the same for DIRECTINPUT_VERSION and other identifiers found in dinput.h.
None of the following work:
DirectInputCreate()
DirectInput8Create();
DirectInputCreateEx();
Think I'm running into stupid compiler problem as there is nothing wrong with my code.
Thank you MSVC.
Code:#ifndef _DXINPUT_ #define _DXINPUT_ #include "DXEngine.h" #include <dinput.h> class DXInput:public DXEngine { protected: LPDIRECTINPUT lpdi; public: DXInput(void); ~DXInput(void) {if (lpdi) lpdi->Release();}; }; #endifCode:#include "DXInput.h" DXInput::DXInput(void) { if (FAILED(DirectInputCreate(MainInstance,DIRECTINPUT_VERSION,&lpdi,NULL))) { //error } }
Later I will throw exceptions when this does not work. However, the damn compiler won't call DirectInputCreate because it says its undefined which is bs because I checked dinput.h myself and its there. What is going on?
MainInstance is a protected member of DXEngine in case anyone was wondering.
Please help me on this one geniuses. Bubba is all out of ideas and that does not happen very frequently.
Ever been programming away having a very productive day and then wham! you hit some roadblock that...shouldn't be a roadblock.
All www.gamedev.net examples are nearly identical to Andre Lamothe's. Something is amiss here and I gotta figure it out or I'm gonna pick up my system and chuck it out the window....well maybe not but you get the idea.
I rarely am so impatient but I'm so close to getting the engine done and am anxious to begin work on actual game data for it.
Help.
Fixed it.
Thanks Fordy.
I thought that DIRECTINPUT_VERSION was defined inside of dinput.h which is why none of this made sense. But I guess you must tell it which version you want to use so that the conditional compilations inside of dinput.h will allow you to use DirectInputCreate(). Kind of convoluted if you ask me.
Anyways, thanks a million Fordy. I owe you big time!!!