10

A Display Model

The world was black and white then.

It didn´t turn color until sometime in the 1930s.

– Calvin´s dad

This chapter presents a display model (the output part of GUI), giving examples of use and fundamental notions such as screen coordinates, lines, and color. Line, Lines, Polygons, Axis, and Text are examples of Shapes. A Shape is an object in memory that we can display and manipulate on a screen. The next two chapters will explore these classes further, with Chapter 11 focusing on their implementation and Chapter 12 on design issues.

§10.1 Why graphics?

§10.2 A display model

§10.3 A first example

§10.4 Using a GUI library

§10.5 Coordinates

§10.6 Shapes

§10.7 Using Shape primitives

Graphics headers and main; Axis; Graphing a ...

Get Programming: Principles and Practice Using C++, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.