Posts

Showing posts from February, 2019

Why use C++? Why not C, ASM, or Java?

Image
I had a few other language choices that I was kicking around when planning this book. Although there are acolytes out there for Delphi, VB, and even C#, the only languages I seriously considered were C++, Java, and C. Java is designed by Sun Microsystems and an inherently object-oriented language, with some high-level language features like garbage collection. C is about as low level as programming gets without dipping into assembly. It has very few if any high-level constructs and doesn't abstract anything away from the programmer. C++ is an interesting language because it essentially sits directly between the functionality of the other two languages. C++ supports COM better than C does (this is more thoroughly discussed in Chapter 1). Also, class systems and operator overloading generally make code easier to read (although, of course, any good thing can and will be abused). Java, although very cool, is an interpreted language. Every year this seems to be less important: JIT...

Why use Direct3D? Why not use OpenGL?

Image
For those of you who have never used it, OpenGL is another graphics API. Silicon Graphics designed it in the early '90s for use on their high-end graphics workstations. It has been ported to countless platforms and operating systems. Outside of the games industry in areas like simulation and academic research, OpenGL is the de facto standard for doing computer graphics. It is a simple, elegant, and fast API. Check out http://www.opengl.org for more information. But it isn't perfect. First of all, OpenGL has a large amount of functionality in it. Making the interface so simple requires that the implementation take care of a lot of ugly details to make sure everything works correctly. Because of the way drivers are implemented, each company that makes a 3D card has to support the entire OpenGL feature set in order to have a fully compliant OpenGL driver. These drivers are extremely difficult to implement correctly, and the performance on equal hardware can vary wildly based on dr...