Problems with DirectDraw...

Started by
6 comments, last by derekyu 22 years, 5 months ago
As suggested by one of the Gamedev.net DirectDraw tutorials, I included ddutil.h and ddutil.cpp into my project so I could use DDLoadBitmap() to load an image to blit. The problem is that my compiler doesn't seem to recognize IDirectDraw4, IDirectDrawSurface4, etc., as a storage type, which it mistakes as an identifier. Nor does it recognize DIRECTDRAWSURFACE4 or DDSURFACEDESC2 as a type. DIRECTDRAWSURFACE and DDSURFACEDESC it recognizes. I'm using DirectX 6.1, so I'm not certain what the problem is. I've included ddraw.lib and winmm.lib into my project -- is there something else I have to do before the compiler will recognize these later interfaces? I'm a noob, to be sure. Thanks for any help you can give me. ~d Edited by - derekyu on November 4, 2001 8:24:45 PM
Advertisement
get the latest sdk''s, it should probably fix it, and be sure to include libraries of directx (newer version) before any other libs, there is basic dx support with msvc++ but like i said be sure to pull up the libraries before the other default libs because its going to load the legacy ones. Do the same thing with the headers too.

May the code be with us !
May the code be with us !
ho, and btw IDirectDrawSurface4 and everything that starts with the I... is a struct but not a type specifier so it wont recognize it as a type, so this may be your error, use the LP... stuff wich stands for local pointer blah blah blah, should be simpler to manage

May the code be with us !
May the code be with us !
Argh, the problem is definitely that the compiler is loading the legacy ddraw.h. So I created a new project, and included the newer ddraw.lib and even the newer ddraw.h directly into my project, but C++ still decides to add the old ddraw.h (without the new definitions I need) as an external dependency.

Oh, I also made sure that ddraw.h was the first header that each .cpp file included.

Is there anything else I can do to get around this? Can I tell the compiler where to look for the latest DirectX files?

~d

(and thank you very much for the help!)

Edited by - derekyu on November 4, 2001 10:55:38 PM
Which compiler are you using?
Visual C++ 6.0!

~d
VC++ 6 includes, I think, the SDK for DX3. Make sure you''ve set the paths to the .h and .lib files correctly in Tools->Options->Directories, and that the paths to your newer sdk are above the default VC++ include paths, as it checks them in order.

That should fix the compilation, but you need to link with dxguid.lib as well.
Thanks, Ruval, that did it.

~d

This topic is closed to new replies.

Advertisement