Archived

This topic is now archived and is closed to further replies.

Fuge

Mixing DirectX versions?

Recommended Posts

Fuge    122
I have been in the process of writing a multiplayer game for about a year and a half now. It makes heavy use of DirectDraw in DirectX7. Up till now, I was going to use sockets for my networking side of my game, since DPlay didnt seem to be quite where I wanted it to be. Well, now DPlay8 seems to be a great improvement over the last version, and I actually have an interest in using it. Problem is (as you know) DirectX8 doesnt use DDraw anymore. So my somewhat bizarre question is this: Is it possible to use all of the libraries from DirectX7 SDK and then just use DirectPlay from DirectX8? It seems reasonable that each part of DirectX functions as its own component, so there may not be a problem at all. Anyone have any experience with something like this?

Share this post


Link to post
Share on other sites
Nairb    766
Hi,
The DDraw7 includes & libraries are still packaged with the DirectX 8 SDK, so if you want to use DDraw7 along with DPlay8, you will have no problems. There shouldn''t be any changes required. DInput8 is slightly different from 7, but you''d only have to change a few lines of code. DSound8 seemed a lot different from DSound7, so if you''re using that I''m not sure what you''d do, ''cause I don''t really think there''s an easy way to use the DSound7 libraries if you only have DSound8 installed.

--Nairb

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Well, now that its gone completly off topic...
All new versions of DirectX are backwards-compatable with older ones. Its in teh documentation, although I doubt many have read that far into it.

As for your example, using Dsound 7 when DX8 is installed, you should realize that this works. Look at every game you currently run that utilizes directX, most of which where in the development phase ~2 years past. Only the games released within the last 6 to 8 months will use DirectX 8, whereas the rest are running with older code, yet obviously work just fine!

Share this post


Link to post
Share on other sites
granat    122
I''m mixing DirextX versions..

I use:

DxGraphics
DInput6
DSound6

It works but only after mixing the two SDK''s files. What a mess. And I get lot''s of warnings. Crap !

Share this post


Link to post
Share on other sites
buzzy_b    122
Anon: Yes its very true that the DX runtimes (DLLs) are backwards compatible, but I think the question is dealing with the SDK and development. Like granat said, I think the only way to really be sure is to mix the SDKs (I think, could be wrong). That is unless the newer SDK didn''t change the features too much for whichever component you''re using; in which case you''d just need to change a few lines of code to get your project to compile with newer SDKs (like Nairb said). Just wanted to clarify that.

--Buzzy

Share this post


Link to post
Share on other sites
a person    118
you NEVER mix the sdks. you dont need to, thats what com is for. the newer sdks give the definations for all the old interfaces. just the things like LPDIRECTBLAH type declartions are upgarded to the latest. you should declare things using IDirectBlah6 or IDirectBlah8 this gives more control. also the guids can be used to upgrade the interface. there are also defines which can be set which tell the compiler which version to default to (since lots of things use #ifdef). ppl really need to learn to RTFM. i am mixing dx versions as well (btw you can only mix versions from different subsets which means while you can mix dd7 and dsound8 you cannot do dd7 and dgraphics8). i use dd7 with dsound6 and directshow8 all in the same project using the dx8 sdk as the only installed or referenced sdk. just remeber you should always use the IDirect* form of things and not the all caps version, it will save you from headaches.

again NEVER mix sdk headers, it will lead to problems that are hard to track down.

Share this post


Link to post
Share on other sites
ajoling    202
Just remembere that DX3 in Dx8 isn''t the original DX3 in DX3 =-)
There are still bugfixes bineg made to previous versions. I believe the current DP3 in DX8 isn''t completely compatible anymore with the DP3 in DX3..

Share this post


Link to post
Share on other sites
a person    118
get what? that you should only have one installed dx sdk? NEVER mix dx sdk installiations? or use the proper type names vs the typedefed/#defined nice names?

Share this post


Link to post
Share on other sites
granat    122
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)?

Share this post


Link to post
Share on other sites
a person    118
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.

Share this post


Link to post
Share on other sites