Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replacing legacy DirectDraw code

Yesterday I found source codes for my Tetris game developed many years ago in C++, Win32 API and DirectDraw 7. I tryed to build solution without any success because most recent DirectX SDK (June 2010) does not include DDraw.h and DDraw.lib any more.

Is there any recommended approach (hopefully with examples) to upgrade code from DirectDraw to newer API? Or should I simply install older DirectX SDK?

like image 941
Ladislav Mrnka Avatar asked Dec 10 '10 09:12

Ladislav Mrnka


People also ask

Is DirectDraw deprecated?

But I was disappointed to discover that DirectDraw is deprecated. After installing DirectX SDK July 2010 there is no ddraw.

What is DDrawCompat?

DDrawCompat is a DLL wrapper aimed at fixing compatibility and performance issues with games based on DirectDraw and Direct3D 1-7. Partially supports GDI as well. There is no API conversion involved, most of the rendering is still done by the native DirectDraw/Direct3D 1-7 and GDI libraries.


1 Answers

If you use DirectDraw blit functionality then it will be quite a task to port it. In my opinion your best option is to port it to GDI. It may mean writing your own blit functions however.

Failing that you could port to D3D though this will be quite a task and is really dependent on how you do your rendering. If all your rendering is performed using blits (and no direct frame buffer access) then it should be relatively straight forward to port it to D3D. It will also provide you with HUGE speed boosts.

That said you can just get hold of the DirectDraw headers (I believe they are in the Windows SDK) and continue using DirectDraw.

like image 67
Goz Avatar answered Sep 21 '22 04:09

Goz