Game Development Reference
In-Depth Information
Compilers
C++ is a compiled language; this means that the code is read by a program that converts the text
source files created by a programmer into instructions that can be executed by a processor. Different
settings in compilers, or different compilers, can be used to turn source files into instructions
suitable for completely different processor architectures, such as x86 and Armv7.
The major compilers currently in use are the following:
Microsoft Visual C++ Compiler (MSVC)
GNU Compiler Collection (GCC)
Apple LLVM
Clang
These are the compilers that this topic is most concerned with, as they are the most likely to be
encountered by game developers. MSVC is the compiler included with the Microsoft Visual Studio
IDE and used when writing programs for Windows and Microsoft game consoles such as the
Xbox One. GCC is common on Linux platforms and is the default compiler used when building
native Android applications. Apple LLVM is the C++ compiler used when building OS X and iOS
applications. Clang is a relatively new program that acts as the front end for the LLVM compiler
(also used in the Apple ecosystem) and is included as an optional compiler by the current Android
Native Development Kit (NDK).
Some of the samples included in this topic might not compile on your compiler of choice if that
compiler is incompatible with all of the latest features of C++11. Switching compilers if possible or
updating your software to the latest versions are possible options to work with these features.
Programming Paradigms
Programming paradigms are closely related to high-level programming styles. C++ does not enforce
a particular paradigm and provides flexible features to enable programmers to program in the
following paradigms.
Procedural Programming
Procedural programming involves writing ordered statements in blocks known as functions
(also known as procedures). Functions are used to encapsulate code that can be reused and to
improve code readability. C is also a procedural language and C++ contains the entire C language
as a subset, allowing C++ programs to be written in a fully procedural manner. Part 1 of this topic
covers the aspects of C++ necessary to write procedural programs.
Object-Oriented Programming
OOP is supported through the addition of classes to C++. OOP involves designing a program as
a set of discrete objects. These objects hide their implementation and data from the calling code
(encapsulation), which allows specific implementation details to be changed at a later time without
 
Search WWH ::




Custom Search