DLLs and Dev Setup

Posted by CodeRedd on January 21, 2014

And so my game engine construction adventure begins...

For this project, I'll be using Visual Studio 2013 Professional to organize the code, and I'll be posting the code to this repository on GitHub as I go. I mentioned in my earlier post that I wasn't sure whether it would be infringing copyright to distribute the source code, but from some cursory googling it seems that there is at least one other ZFXEngine implementation freely available (not to mention that this book is discontinued!), so I should hopefully be able to distribute my code as "my implementation" of their engine specs. If I hear from Thomson books that this is a problem, I'll be sure to let you all know!

Zerbst and Duvel open their description of how to set up the workspace needed to create the DLLs of their engine with a detailed explanation of what it takes to load code out of a DLL, and the pros and cons of using the symbols from a static library file vs. loading them with __declspec(dllexport) vs. loading the DLL symbols with a def file instead. The authors settle on the last option, and I was still quite a bit lost going into implementation, but as the authors brought me step-by-step through the organization of the project workspace, things became a bit clearer. 
 
In this beginning section of the implementation, Zerbst and Duvel even go so far as to take the user through the specific UI needed to create projects and add files in Visual C++ 2003, and thankfully the process hasn't changed much in the past ten years. While I'm somewhat familiar with Visual Studio from previous work, I haven't yet been through the process of creating new DLLs and static libraries from scratch, so having the book cover the tiny details like hitting the "Empty Project" checkbox for the DLL was handy.

One final thing I noticed as I was implementing the first of what will likely be many code samples: Zerbst notes that he is sometimes following bad C++ form. Personally, I'm rather new to C++ so I wouldn't have caught the minutia he mentions, but I'm glad to see that he's at least noting it so I'm aware of where he's breaking with "traditions" of the time.

Progress So Far: Implemented the main interface for the renderer that provides agnosticism between implementation in D3D, OpenGL, etc. and use of the renderer.

Coming Up Next: Implementing the static library that will load the DLL, and implementing the DLL itself. Fun times ahead!

Comments:

Leave a Reply



(Your email will not be publicly displayed.)


Captcha Code

Click the image to see another captcha.


Follow @CodeRedd11 View Culver  Redd's LinkedIn profileView Culver Redd's profile