< Previous | Contents | Next >
Object-oriented programming (OOP) is a
different way of thinking about
programming. It’s a modern methodology that’s used in the creation of the vast majority of games (and other commercial software, too). In OOP, you define different types of objects with relationships to each other that allow the objects to interact. You’ve already worked with objects from types defined in libraries, but one of the key characteristics of OOP is the ability to make your own types from which you can create objects. In this chapter, you’ll see how to define your own types and create objects from them. Specifically, you’ll learn to:
n Create new types by defining classes
n Declare class data members and member functions
n Instantiate objects from classes
n Set member access levels
n Declare static data members and member functions