tags:

views:

249

answers:

3

Gentlemen and esteemed ladies.

I posted this question in the COM forum at Code Project and got a snotty reply so hopefully you will be more helpful.

I see that Microsoft has a COM library for Direct3D 9 exposed with GUID 81BDCBCA-64D4-426d-AE8D-AD0147F4275C.

Has Microsoft exposed Direct3D 10 on COM and if so, what is the interface GUID?

Thanks in advance.

+3  A: 

From the documentation on MSDN, it looks like they've moved from having an IDirect3D9 object with member functions such as IDirect3D9::CreateDevice to using global functions such as D3D10CreateDevice. With Direct3D 10, they've split many of the functions that were in IDirect3D9 relating to (for example) adapters into the DirectX Graphics Infrastructure (DXGI).

In other words, Direct3D 10 still uses COM, but no, there isn't a counterpart of IDirect3D9. Things that you used IDirect3D9 for are now accomplished via other means.

Edit: The COM class with the GUID above is IDirect3D9. Direct3D 10 doesn't have an updated version of this (there is no IDirect3D10 that does the things IDirect3D9 does); instead, the member functions of that class were split into global functions (such as D3D10CreateDevice) which you call directly instead of via an object, and into the DXGI classes (such as IDXGIOutput). You don't need an IDirect3D10 object because the tasks that you would use it for are now done in different ways.

You should be able to map GUIDs to COM class names by searching the Direct3D header files for the DEFINE_GUID macro.

Jason Owen
Dude that's fantastic. Sorry I realise now that my question wasn't 100% going in the right direction. But now that I see the GUIDS in the header files I understand exactly what you mean. Shot for the help!
I'm glad I was able to help it make sense :-)
Jason Owen
A: 

Thanks Jason. That's good help. Do you know where I could begin looking to find the interface GUID for Direct3D 10? I have googled endlessly with no luck. Is there a way in Windows to browse the COM libraries? Thanks in advance

A: 

In COM, library information like you're asking for is encoded in a type library (TLB file). Direct3D hasn't used a type library or CoCreateInstance for any of its objects since DirectX 8.0, almost ten years ago now. Direct3D uses COM interfaces for managing the lifetime of their objects and that's about it. They don't use QueryInterface much at all. Most of the COM infrastructure doesn't apply to the interfaces used by Direct3D and their associated objects.

They don't use CoCreateInstance for creating their objects but instead provide a single factory function (like Direct3DCreate9) from which you get a base interface and then use creator methods from that base interface to get everything else. In Direct3D 10, they recognized that the base interface that enumerates displays and so-on was the stable and the same for D3D 8 and D3D 9, so they moved it into a stable base interface IDXGIFactory. The same DXGI code is used for D3D 10, 10.1 and 11.

legalize