03-28-2002, 08:00 PM
Can i load all the DirectX stuff like the DDraw, DMusic, DSound into a DLL file so i can just call for the DLL when i wanna make my game.. to save time and all?
and. it goes into a module normally right?
03-29-2002, 10:22 AM
Well, sort of.
DirectX already comes with a million and a half DLL's that are required by the each sub-system. But there's one more file that's required by DX in oreder to use it in VB (dx7vb.dll or dx8vb.dll, depending on your target DirectX version). This additional file will be included in every installation package you create and your program will not run without it on the target machine. So technically you already have a DLL that holds are your DirectX stuff.
But if you want to create a custom library that handles some stuff for you, you can do that as well. All you need to do is create a new ActiveX DLL in your project group. Create a reference to it in your program and start your coding. One downfall to this method is that you have the choice of either completely exposing the DirectX framework to your host application, or completely hiding it. Hiding it would allow you grater flexability over how data is controled and your DirectX objects will always be in a completely known state. If you don't want to go through an almost pointless rewriting of DirectX and choose to expose the DirectX framework make sure you have lots of error checks and check the data BEFORE you send it to any DirectX function. It would also be advisable to check for any conficting states that that the device might be set to. In a situation like Murphy's Law comes into full effect: "If it can go wrong, it will go wrong."
My suggestion is to make a module that contains some commonly used functions that will ease the DirectX pain on some of the more complex issues. Then use this module in all the projects that require it.
Whatever way you go, good luck to you!