🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Using a new DirectX interface

Started by
3 comments, last by Gandalf 24 years, 7 months ago
Hello Gandalf

How do you do it ? Please post some code so that i can search for your failure. With DX6 you can take advantage of a new interface by querying for it like this:

LPDIRECTDRAW pDD;
LPDIRECTDRAW4 pDD4;

DirectDrawCreate(NULL, &pDD, NULL);

pDD->QueryInterface(IID_IDirectDraw4, (LPVOID*)&pDD4);

pDD->Release();

You should always check the return value with the SUCCEEDED or FAILED macros so that you can see where the failure happened.

VirtualNext

Advertisement
Hello VirtualNext!

Example, I get this error:

error C2664: 'Direct3DRMCreate' : cannot convert parameter 1 from 'struct IDirect3DRM3 ** ' to 'struct IDirect3DRM ** '
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

I can´t get the new interface! I have included the lib.directorie and the include.directori in the Option menu. I have used the #pragma comment to include ddraw and d3drm. I have #included d3drm.h and draw.h.

Gandalf the Black
Unfortunately, the Direct3DRMCreate() function will only get you a LPDIRECT3DRM pointer: you have to use QueryInterface() to ask that object for the more recent DIRECT3DRM3 interface. Tis be the way COM works, and Microsoft doesn't make functions like Direct3DRMCreate3(), with the notable exception of the new DirectDraw7 interface. You just have to deal with COM issues now.

- Splat

I have DirectX SDK 6.0 on my computer but I can´t create the new objects (IDirectDraw4 etc.). Why? I have added the libs and header-files. I use Visual C++ 6.0.
Gandalf the Black
Thanks for your help! It´s working now.
Gandalf the Black

This topic is closed to new replies.

Advertisement