Skip to main content
gamedev.net
🔒 Locked

DX8 Direct Input

Started by KalvinB Nov 13, 2000 at 8:23 PM 3 replies 550+ views
Original Post
KalvinB
KalvinB
I have a program in DX7 which uses DirectPlay, DirectDraw, Direct3D, DirectSound, and DirectInput. When I installed DX8 everything but DirectInput would work. When I tried to compile I got "DirectInputCreate undefined" or similar. Any ideas? It took a change to one line of code to correct it however now any computer running the program has to have DX8 installed. I''d rather it compile under DX7. Ben
Etnu
Etnu
You didn''t try to change over to use the new DX interfaces right?

Also, if they are going to need DirectX8, whats the big deal? Everyone will have it within 6 months anyway.

Thanks,
Etnu

Sometimes I think I know what I really don''t, but then again usually I do know what I don''t, but just don''t realize it, maybe its because I am so young, but then again it could be because I am insane.
---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.
Aldacron
Aldacron
It sounds like you didn't #define DIRECTINPUT_VERSION before including dinput.h. From the docs:

---------------------------------------------------------------
If you do not define DIRECTINPUT_VERSION before including the Dinput.h header file, the header file generates structure definitions compatible with the current version of DirectInput.
---------------------------------------------------------------

This is your problem, as taken from dinput.h:

#if DIRECTINPUT_VERSION > 0x0700

extern HRESULT WINAPI DirectInput8Create(HINSTANCE hinst, DWORD dwVersion, REFIID riidltf, LPVOID *ppvOut, LPUNKNOWN punkOuter);

#else
extern HRESULT WINAPI DirectInputCreateA(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTA *ppDI, LPUNKNOWN punkOuter);
extern HRESULT WINAPI DirectInputCreateW(HINSTANCE hinst, DWORD dwVersion, LPDIRECTINPUTW *ppDI, LPUNKNOWN punkOuter);
#ifdef UNICODE
#define DirectInputCreate DirectInputCreateW
#else
#define DirectInputCreate DirectInputCreateA
#endif // !UNICODE

(EDIT: hmmm, the source tags didn't format properly)

So, for DX8, DirectInputCreate does not get defined.

Solution:

Before you include dinput.h, do this:
#define DIRECTINPUT_VERSION 0x0700



Edited by - Aldacron on November 14, 2000 9:01:54 AM

Edited by - Aldacron on November 14, 2000 9:03:54 AM
KalvinB
KalvinB
I ended up just including the dinput8.lib as well. I''ll use the #define however and go back to DX7 completely. It''s kinda cheesy only one part of DX7 didn''t work as coded with DX8 installed.

The type game I''m making, ISO, makes DX8 kinda not worth it. If it were full fledged Direct3D sure but it''s not. Combining Direct3d and DirectDraw in DX7 was simple enough that DX8 isn''t worth learning at this point.

Ben

Topic Locked

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

Sign in to reply to this topic.