When using C++ and including d3d11.lib, do you not use the windows registry at all?

Started by
10 comments, last by MJP 8 years, 5 months ago
Hello! Just curious as to how this is working internally. My set up is that I am coding with C++, have included d3d11.lib. As far as I understand this will mean that all DirectX code that I need is contained in .obj files in d3d11.lib and linked and compiled into my exe. What I am wondering though is what happens inside d3d11.lib? for example When you call D3D11CreateDevice is Everything dealt with in the d3d11.lib obj files? or is it the case that still the windows registry is used to get hold of some DirectX com objects? I can't find and d3d11.dll or anything in my windows registry in yet Everything works fine in my application.
Cheers
Advertisement
You don't include a library like d3d11.lib. Include files (typically *.h) are included by the compiler, libraries are linked by the linker. Those are very different steps during the build process happening by different means for a different purpose.

I don't know what happens in D3D11CreateDevice and similar functions but I would expect them to be small stubs which query the correct interfaces from the OS via COM. To my knowledge DirectX 11 is part of the OS, so you will never run into a missing DLL though the device creation might fail if the graphics card driver present does not offer sufficient support.
Hello, thanks for your reply (I was sloppy with my lingo, I did mean that about libraries, i.e. one doesn't "include" them). What you mention is what I am curious about, I know that all these DirectX objects are COM objects so at some Point QueryInterface will be used to get hold of interfaces, but what I'm really curious of is is something like CoCreateInstance used to instanciate one of these DirectX objects in the first Place or is Everything that is needed held inside the library. Maybe there is no answer here because I suppose ideally I just need to debug D3D11CreateDevice, which with no .pdb file (that I am aware of) that ain't gonna happen. Cheers!

Why do you really want to know whats going on inside of the lib? Is something not working for you that you need more information on than what you currently have.

If its just to learn how COM works there are lots of tutorials on the web for that that can show you how you should work with them.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

Hello, thanks for your reply - I know how COM works... I only want to know what happens inside the lib out of curiousity - and to know if it is possible. Thanks!
Yes, the lib will contain just barely enough code to call out to a d3d11 DLL in the OS. The OS will implement the D3D user-mode driver, which in turn will call the D3D kernel-mode driver, which will call NVidia/AMD/Intel kernel driver code, which interact with the hardware.

I don't know what the registry has to do with it, but I found 9 different d3d11.dll files in my Windows directory.
Thanks very much Hodgman, this is what I was fishing for. I guess it isn't possible to debug the lib though as there is no pdb? Cheers
If you're lucky, VS will fetch the debug data from tge MS symbol servers. Probably a better way to learn whatever it is that you're after than to reverse engineer that lib though...
Thanks Hodgman, I tried stepping in to D3D11CreateDevice in VS13 but to no avail, I'll have a go trying maybe with VS2015 and try some other things, otherwise your explanation above is all that really I am after. Thanks for the help.

I'm not sure if this is what you're looking for: https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index/, but it might help.

This topic is closed to new replies.

Advertisement