This book introduces the reader to C++ via computer graphics - the perfect example to illustrate the object-oriented programming features of C++. It is based around a central theme - computer graphics and the development of 'real' object-oriented tools for graphical modelling. It demonstrates and shows how to apply the syntax and features of C++ as well as explaining the theory. No previous knowledge of C++ is assumed and all graphical applications are explained throughout the text. The more advanced features and applications of C++ are covered in the second part of the book. The breadth of coverage is such that all those from novice programmer through to those wanting to apply object-oriented programming techniques to computational graphical modelling projects will find this book of immense value. Why Another Book on c++ and why Programming and Graphics? Anyone who has browsed through the 'Computing' section of a bookshop (assuming it has one) will not need much convincing that there are a lot of C++ books out there. So why add yet another to the shelf! This book attempts to introduce you to the C++ language via computer graphics because the object-oriented programming features of C++ naturally lend themselves to graphics. Thus, this book is based around a central theme: computer graphics and the development of 'real' object-oriented tools for graphical modelling. This approach is adopted (as opposed to learning by small, unrelated, often hypothetical, examples) because I didn't want to introduce C++ as a collection oflanguage features. While introducing the syntax and features of C++, it is just as important to demonstrate simultaneously the reason for such features and when to apply them - in otherwords,language and design are given equal priority. Also, a key objective in writing this book is to present you with a comprehensive introductory text on programming in the C++ language Front Matter....Pages i-xl Overview....Pages 1-23 The Development Environment....Pages 25-30 Getting Started....Pages 31-44 Fundamental Data Types, Declarations, Definitions and Expressions....Pages 45-83 Making Decisions and Repetition....Pages 85-124 Functions....Pages 125-182 Arrays....Pages 183-213 Structures, Unions, Enumerations and Typedefs....Pages 215-247 The C++ Class....Pages 249-317 Operators and Overloading....Pages 319-351 Friends....Pages 353-375 Pointers....Pages 377-483 Templates....Pages 485-565 Exception Handling....Pages 567-610 Inheritance....Pages 611-755 Run-Time Type Information and Casting....Pages 757-776 Input and Output, Files and Streams....Pages 777-902 The Preprocessor....Pages 903-916 Namespaces....Pages 917-931 An Application: a Simple Raytracing Program....Pages 933-1017 Conclusion....Pages 1019-1020 Back Matter....Pages 1021-1048 In the words of the original designer of C++, B. Stroustrup (1991, Preface to the first Edition): C++ is a general purpose programming language designed to make programming more enjoyable for the serious programmer.