Chapter 5. Function and Operator Overloading


Before we go much further in game programming, you must know how to write programs in which multiple C++ functions have the same name. This is an important feature of C++; its formal name is function and operator overloading.

Also, every game programmer must know some math. I realize some people may experience physical pain when I say that, but the math needed for games isn't actually very hard. Specifically, we're going to talk about vectors. Vectors are so common that every game programmer has to be able to use them. Before we can move on to talking about how to write even simple games, I have to cover them.

Although overloading and vectors may seem like unrelated topics, they are actually closely connected in game programming. To be specific, when you write a vector class, you must use overloading. Therefore, in this chapter, I explain overloading and then show how to use overloading to write a vector class.



Creating Games in C++(c) A Step-by-Step Guide
Creating Games in C++: A Step-by-Step Guide
ISBN: 0735714347
EAN: 2147483647
Year: N/A
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net