Mixing DirectX versions?

Started by
11 comments, last by Fuge 22 years, 2 months ago
I just did not think that you were being very clear that''s all. Never mind.

Are you saying that this will give me headaches ?

  LPDIRECTINPUTDEVICE         m_pDirectInputDevice;  


I think this is my real problem

  hRet = DirectInputCreate(hInstance, DIRECTINPUT_VERSION, &m_pDirectInput, NULL );  


DIRECTINPUT_VERSION should not be passed. Instead I should use the DEFINE for VERSION 6 right (If I''m using the sdk8 and wnat to use DirectInput6)?
-------------Ban KalvinB !
Advertisement
you could do a
#define DIRECTINPUT_VERSION 0x0500

before you include any dx headers. this will downgrade the types and such so you can use LPDIRECTINPUTDEVICE macro style declarations.

i merely was trying to say using COM style declarations (damn i wish i thought of calling them that when i tried to explain before) like IDirectInputDevice7 are preferred so you no exactly what interface you are using.

also a small excerpt from the dinput.h header file

quote:
/*
* To build applications for older versions of DirectInput
*
* #define DIRECTINPUT_VERSION [ 0x0300 | 0x0500 | 0x0700 ]
*
* before #include <dinput.h>. By default, #include <dinput.h>
* will produce a DirectX 8-compatible header file.
*
*/


hope that clears it up more. (btw when they use [ 0x0300 | 0x0500 | 0x0700 ] it is a sign of optional parms that you can use, you pick only one of the numbers to use.)


also just to reiterate:
you MUST place the #define above the includes and still pass the DIRECTINPUT_VERSION macro to the functions like normal. otherwise you will serverly screw things up (like having a version 8 object filling a version 6 interface, bad mojo and may cause many debugging headaches (again why i perfer COM style declarartions vs the macro declarations)).

to avoid all headaches dealing with interface version you can jutst use COM to create the objects. though that may be tricky at first since COM is a bit confusing (even though you have been using the basics of it with dx and probally did not even know it).

i tend to ramble which causes confusion, heh. the problem is i tend to write as i think it so you get a bit of stream of conscienece thing going. oh well. this time it was written more clearly i hope.
Just want to say that I did what you said and it worked...I''m now using the dx8 sdk only...WOHUU...no warnings.....
-------------Ban KalvinB !

This topic is closed to new replies.

Advertisement