Initialization Complete!

Posted by CodeRedd on February 5, 2014

As the title of this post suggests, I have successfully completed the part of the renderer that requests user decisions on hardware/device settings and uses that information to get Direct3D ready to start doing the heavy lifting. And really, I think the title is doubly apt, as I feel as though I have reached an internal milestone as well. When I began this project, I had never before dealt with Windows coding basics like HWND, I'd never had to create references to new DLLs, and I had no clue that DirectX concepts like combos and swap chains even existed! While I'm certainly far from calling myself well-versed in any of these things, I think I've reached the point where I know enough to be able to begin wrapping my head around the intricacies of the Windows and DirectX SDKs and be able to explore their contents outside the bounds of what is immediately useful for this project. In a sense, my brain is initialized too.

A couple other observations from my latest bout of coding that I'd like to share:

-In a few places thus far, Zerbst and Duvel (the authors of 3D Game Engine Programming) have noted that some aspect of their code samples is taking the quick and dirty route to solving a problem. Since I'm reading their book as a learning project, it's quite frustrating that they neglect to describe what the "right way" is to do something! For instance, they mention that they are using a global variable to hold a singleton, but neglect to explain why this is bad form and what the better programming style would be. While I appreciate that they do note when they do this, I will have to be wary of unintentionally picking up any bad habits.

-As the authors guide their readers through the process of creating a dialog callback function (called DlgProc), they proceed to wrap the callback doing the real work inside a one-line wrapper callback. They say this is because the compiler will face a conflict: it must verify the existence of the dialog's callback function at compile time, but there is something about DlgProc that is too object-oriented, meaning that that function can only be defined when an instance of the renderer object is created at runtime. Thus, the wrapper function exists as a way to have a callback definition that exists at compile time. However, I'm not precisely certain what it is about DlgProc that is causing the problem. To any knowledgeable readers out there: can you look at my code on GitHub and explain to me what is going on here?


Progress So Far: The engine can now take input from the user about what device settings should be used (fullscreen/windowed, device types, adapter and back buffer formats, etc.) and use that input to initialize a new Direct3D device.


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