Jump to content
  • Advertisement
Sign in to follow this  
Picaro

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

This topic is 998 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!