Game Development Reference
In-Depth Information
C++
C++ is a statically-typed, compiled, intermediate-level language and is actually the
most used programming language for game programming. It can be considered, eas-
ily put, a version of the popular C language with object-oriented features, which in-
clude the ability to create classes.
C++ is implemented on several hardware configurations and operating systems, and
being a very efficient way to compile native code, it is used to develop system soft-
ware, applications, device drivers, data servers, and naturally, video games.
Renowned companies such as Microsoft and Intel offer C++ software compilers (for
example, the popular Microsoft's Visual Studio) to create and manage programs
written with C++. You can check the latest version (at the time of writing) Visual
Studio 2012 Express at http://www.microsoft.com/visualstudio/eng/products/visual-
studio-express-products .
Being such a versatile programming language, C++ has influenced several other lan-
guages that are used for game programming, such as Java and C#. If you are about
to decide which programming language to learn to begin with, C++ should be your
first choice!
Memory management
When programming mobile games, memory management is a crucial aspect to en-
hance the performance of your code, while keeping the hardware requirements for
your applications as low as possible.
C++ offers four types of memory management techniques:
Static memory allocation : This means that values are assigned to variables
once and for all inside a program, so that these values do not change during
the execution of the program. To achieve that, the static keyword is put in-
side the variable name in the variable declaration section of the code.
Automatic memory allocation : This implies that the amount of memory al-
located to store a variable value is automatically freed once that variable goes
out of use in the program. This operation is performed by a special method
available in C++ called destructor.
Search WWH ::




Custom Search