is DX backwords compatible?

Started by
13 comments, last by Red Falcon 19 years, 5 months ago
i'm a total noob with api's, i just wanted to know if DX was backwords compatible. if i program my code in DX8, can it work in DX9? i was told that they got rid of directdraw and replaced it with direct3d. also is OGL backwords compatible?
Thanhda TieDigital Shock, Technical Director & Business Relations15-75 Bayly Street West, Suite #173Ajax, Ontario, L1S 7K7Tel: 416.875.1634http://www.digitalshock.net
Advertisement
Yes, DX is backwards compatible. I think it only goes back as far as DirectX 4..but I could be wrong. Though I don't think code for DirectX 1 even exists anymore. (From what I heard of it, I hope it doesn't =)

My graphics engine is 2d and runs in DirectX 7 (cause it's all DirectDraw and DirectDraw doesn't exist after DX7). I use the DirectX9 SDK, but all the old code still works. You just gotta be consistent.

Good luck.
really? i see i just created some code from this book i have that uses DX8, it compile fully. but when i try to use .net with DX9 SDK at my school, i get all these errors. this is just concernning. i'm currently trying to build a small basic engine that may posibly get bigger, i just dont want to have my code become obsolite, and not usable in future SDK's, or have to reprogram like 500 lines of code. my next question is OGL backwards compatible?
Thanhda TieDigital Shock, Technical Director & Business Relations15-75 Bayly Street West, Suite #173Ajax, Ontario, L1S 7K7Tel: 416.875.1634http://www.digitalshock.net
This is an error that drove me away from game programming for a whole year, so I will try to steer you away from it if it is in fact what's happening to you.

Make sure that whatever IDE you're using has its include directories set properly. So long as it knows to include your DXSDK folders, your DirectX legacy code *will* compile.

That is, if your code is correct.
well i'm currently inrolled at toronto's game design and development, and they have DX9 SDK installed, our class hasnt really touch DX yet, but i have. i got some nice books based on DX8, and by testing if it works, i compile the DX code from the books on my PC, it works fine with the DX8 SDK, but when i tried to compile it at my school, it doesnt. not sure why.
Thanhda TieDigital Shock, Technical Director & Business Relations15-75 Bayly Street West, Suite #173Ajax, Ontario, L1S 7K7Tel: 416.875.1634http://www.digitalshock.net
Again, check that the include directories on your target system's IDE is set properly. I have only the DirectX 9 SDK, and I am constantly compiling DirectInput8 code and DirectDraw7 code. I promise it works.

If it compiles on your home system, the include directories for your *Project* on the school system are incorrectly set. When you load up on the school computer, check your personal session settings. If it is MSVS, or a derivative, it's under Tools..Options..Directories. Add DXSDK/INCLUDE to the include list...you'll also have to add the header directory in the same way.
I'm not familiar with OpenGL, but am very familiar with DirectX. I HIGHLY recommend using Direct3D instead of DirectDraw. Whether to use 8 or 9 is not so important; use 9 if possible, but using 8 should be fine; it only took me a few days to update my fairly large D3D 8 game engine code to 9, anyway, albeit minor problems.

I had a terrible experience when I tried running my old DirectDraw engine on my new (at the time) WinXP machine over a year ago. I wrote it using DX 6.1, and WinXp comes with 8. Primarily, the graphics were drawn all screwed up, but it worked fine on my old Win 98SE PC. Even the good people of GameDev.net couldn't offer help. I gave up on DirectDraw and spent the next eight months converting to D3D 8 and taking a big sanity break. Innumerable problems almost led me to abandon my game project, though I did get through it ultimately.

In short: Use Direct3D over DirectDraw, unless you enjoy pain!

Best wishes. :)
To be fair, I have to say DirectDraw is a *lot* simpler to understand than Direct3D. Having tried both I admit that I've put off another foray into 3d land until I get beefed up on my calculus. 2d's just fine for me, and DirectDraw surfaces - while they take some getting used to - really aren't that bad for the beginner.

Though there are admittedly few of us left who understand DirectDraw at all. =) I'll try to answer whatever questions you have about it when they come up. Andre Lamothe's book is good, as I said, and also all the documentation you could ever ask for (and more) can be found on MSDN.
if the errors got something to do with unicode lpcwstrings etc then i strongly recommend taking the school's computer, drive to redmond and shove it up the *censored* ... well, i'm not really happy with the new dx9 as you can see... i tried to use it some time ago and used a small example i made before in dx8 and tried to change all 8s into 9s and i changed the project's properties to unicode. but it wouldn't compile. now i hate dx9 but i guess it's just something small i overlooked in my rage. as soon as i have time i'll see what i can do to get it running. if not i'll go back to ogl.
Quote:Original post by BrianMJC
Whether to use 8 or 9 is not so important; use 9 if possible, but using 8 should be fine; it only took me a few days to update my fairly large D3D 8 game engine code to 9, anyway, albeit minor problems.
Best wishes. :)
i guess i did something wrong... i had big problems with the update :/
maybe i suck... yeah, that's the reason :|
Now get down on your hands and knees and start repeating "Open Source Good, M$ Evil", smacking your head against the pavement after each repetition. Once you have completed your training you may change your first name to GNU/, to show that you are free from the slavery of the closed source world. -Michalson
People are becoming too touchy feely on this thread and is forgetting to answer the question... ahem...

So here is the low down.

DirectX inherits from COM (now replaced by NET) so that all your previous COMPILED DirectX programs SHOULD run on new versions of DirectX. That is the COM specification.

It is an entirely different thing when you are trying to compile legacy source code under the new DirectX SDKs even if you do specify that the headers and libs you want are that of previous versions. Been there, done that, it simply will not work or will not work very well.

If you are using DirectX8 however, the good news for you is that the API changed little and it should not be very difficult to port it over to the latest DirectX9 SDK.

This topic is closed to new replies.

Advertisement