You are on page 1of 7

C++ for Game Programmers

Course Description
C++ has become one of the favourite programming language for game programmers. Reasons for wide spread acceptability of C++ are plenty, but primary reasons are, that it allows programmers to better manage program complexity without loosing performance. C++ popularity will only grow further in the coming years with games increasing in complexity and size. Having a good command over C++ is essential to anyone planning a career in game or graphics programming. It is to fulfil this objective that we have designed this course. Focus in this course will be to get programmers started with and then eventually gain a firm grounding in C++ with a focus on game and graphics programming. The course would be highly interactive with lots of example code and programming exercises to give the student a hands on experience. The course is divided in 2 Parts, Part I will deal with basic and intermediate C++ programming, Part II will cover more advanced C++ topics and windows programming. Part II will also cover game programming fundamentals and finally a complete 2D game will be developed using the knowledge in the previous topics. Code portability will not be covered as a separate topic, however tips will be given on how to keep code portable.

Platform and Tools

We will be using Windows platform for this course. Microsoft Visual Studio 2008 edition will be used for programming during the course. All example code also is based on MS Visual studio 2008. Paint.Net will be used to create and edit graphics for the game. The same will be provided to the student. It is an open source project and executable can be downloaded for free.

This course should be the first stepping stone in the journey to be a master game programmer. Prerequisites are as follows: Knowledge of computer programming (any computer language) is required. The student should be familiar with editing and compiling source code. Knowing how to use Microsoft Visual Studio will be helpful.

PART I 1. Comparison of C & C++

2. Getting Started with Visual Studio C++. How to create a C++ project Introduction to Visual Studio C++ compiler Visual Studio C++ settings

3. Hello World in C++ Your first C++ program. Hello World explained Basic program structure Pre-processor Directives Declaration and Definition

4. Variables & Constants Fundamental Data types Naming Variable Scope Initialization Constants

5. Pointers and References Pointer basics De-referencing Pointers Using pointers to pass data to functions Using pointers to return multiple values from functions Pointer arithmetic Function Pointers Reference basics Constant References Passing references to functions Returning references from functions

6. Arrays and Structures Defining and Initializing Arrays Passing arrays to functions Multidimensional Arrays Defining and Initializing Structures Practical use of structures

7. Expressions Arithmetic Operators Logical Operators Relational Operators Bit-wise Operators Arrow Operator sizeof Operator

8. Program Flow Decision making if, switch, conditional operator Loops for, while, do-while statements Goto statement

9. Functions Variable scope User defined functions Default Arguments Function Overloading Friend functions Inline functions Math functions

10. Classes Class declaration Access specifiers Object and References Object on heap Constructors and Destructors Separating Interface from Implementation Objects and References Array of Objects Static members of class this pointer Const objects and const class members

Nested classes

11. Basic Memory Management Heap vs stack Object Construction & Destruction Copy constructor Operators new and delete Temporary Objects Pass by value and reference Returning objects, object references and object pointers

12. Operator Overloading Operator Function Operators that cannot be overloaded Overloading Unary Operators Overloading Binary Operators Interpreting Operator function call Assignment Operator Implicit and Explicit Overloading mechanism Overloading new and delete operators

13. Object Oriented Programming Inheritance Is A relationship Single vs Multiple inheritance Inheritance in private, protected and public mode Constructors and destructors in derived class

Polymorphism Compile time vs Runtime Polymorphism Function/method overriding Base class pointers and derived class objects Virtual functions Virtual inheritance Virtual destructors

Why are there no virtual constructors?

Developing a class hierarchy framework Interface based programming Abstract class Pure virtual functions Defining an interface Implementing an interface

Developing a plugin framework

14. File I/O Streams Text File I/O Binary File I/O

15. Templates Basics Function Templates Class Templates Non-Type template parameters Tricky basics Specialization

16. Errors & Exception Handling Error Codes Exception handling fundamentals ASSERT

17. Standard Template Library (STL) Containers and Algorithms Introduction to STL Linked Lists Stacks Queues Maps Algorithms

PART II 18. Run Time Type Identification (RTTI) Runtime Polymorphism & RTTI Typeid & type_info RTTI framework Casting operators

19. Effective C++ usage and Performance Optimization Dealing with large projects Smart Pointers Object Creation and Management Inline functions Preventing excessive object copies

20. Object Serialization

21. Windows programming Introduction to windows programming Introduction to windows mensu, dialogs etc. Programming windows DLLs(Synamic Linked Libraries) Multi-threading

22. Introduction to GDI (Graphic Device Interface) Drawing basic graphics Drawing Images Animation

23. User interaction programming

Keyboard Mouse Joystick

24. Basic Audio programming Creating a basic audio framework

25. Game Programming basics Developing a basic game framework Adding user interactivity Building the game options Adding sound support to the game Adding basic AI into the game

26. Programming your first 2D game