I got the book Game Engine Architecture by Jason Gregory for Christmas. If you’re a technical geek, even if you’re not really into game design, this book is a must-have.
At 1,200 pages, this is a massive tome. It must be Jason Gregory’s “Magnum Opus”. I was delighted to see that, aside from the expected content on 3D Math, Rendering, Animation, Collision Detection, Audio, etc. it also delivered some hardcore computer science content on compiler optimizations, profiling tools, C++ coding practices, parallelism and concurrent programming, file systems, debugging, and a bunch of other topics.
So, if you’re like me, you’ll run, not walk, to buy this book. It will be providing me with months of fun reading.
There are 23 chapters in the book 3D Game Programming with DirectX 12 by Frank D. Luna; most of which have little demo programs that you can download, import into Visual Studio, compile and run. The first 80 pages of the book crawl (slowly) through some of the math needed for 3D graphics: Vector Algebra, Matrix Algebra, Transformations, etc., and it’s pretty heavy going. To keep myself entertained in the meantime, I’m skipping ahead and honing my C++ and Visual Studio skills by working with the demo programs. I’ve actually learned a lot, as you can see by the prior two blogs, by overcoming some shortcomings in the programs introduced in the four years or so since the book was published.
I got up to Chapter 10 of the book’s demo programs when I hit a snag: even after applying all the workarounds I found out about, I got some new errors when I compiled a “Blending” demo application:
There are a bunch of C2102 “‘&’ requires l-value” errors coming out of the program compile. I worked my way through the code, pulling my hair out, until I found someone else with the same problem https://github.com/microsoft/directx-graphics-samples/issues/652 dated September 22, 2020. It turns out that some Visual C++ updates for the latest release changed something called “/permissive-“. Luna’s code is non-conforming to the new update: specifically, we’re using r-values and not l-values in these lines of the software.
So, problem easily solved! I right-clicked on the Project, chose Properties, then C/C++ -> Language and changed Conformance mode from “Yes” to “No”.
Then my program ran nicely:
Whew! This is probably not the best way to solve the C2102 errors, though. I’ll explore the code a little more, and introduce some fixes that address the VC++ updates for /permissive-.