Jump to content
Posted 03 January 2013 - 10:35 AM
Posted 03 January 2013 - 11:47 AM
if you create the direct3d device in a dll,you don't need to include the directx headers in a project that uses that dll,you can just call functions inside the dll that will use the device(that is in the dll ofcourse) to do stuff
I see that you have answered the query yourself. The reason why you won't need to include same headers into the project, that's using the dll which provides the functions needed, is because that header and related info is already included in the dll.
This is sort of a rule and doesn't change for any .h, .pch. cpp, .cc, .etc. leave alone windows headers.
Posted 03 January 2013 - 11:57 AM
Posted 03 January 2013 - 09:10 PM
but wait...does that mean that for exemple if I include a directx sdk header in a dll,that header will just get in the dll file? So if I move the dll to another PC,it won't need the directx sdk,because the header file is already in the dll itself?
Unless you're trying to use the same functions from the sdk, which also have been included in the dll, you won't need the header.
Lets consider an example :
A project called MyGraphicsImpl is created, that provides the direct3d implementation as part of their MGI.dll. Now you want to use this project and do some of your own things.
They have a method called CustomCreateDevice, which basically does a Direct3D CreateDevice internally. Ofcourse, to use CustomCreateDevice you need to include their header called CustomCreateDevice.h in your code. But there is no need to use anything from DirectX SDK anymore.
This is the underlying concept of quite a few third party source code that is developed and used across the fraternity.
I hope this explains the idea.