How it works...
GLUT is initialized and a top-level window is created with the label, Displaying Bar Chart. The initial position of the window is set at 0,0, that is, at the x=0 and y=0 coordinate location. The window size is specified as 500 px in width and 500 px in height. The display callback function is invoked for drawing the bar chart.
In the display callback, a result array is initialized to three values. Basically, the values in the resulting array represent the growth in profit percentage of the company in the last three years. Let's assume the growth in the profit percentage of the company in 2019, 2018, and 2017 was 10%, 15%, and 5%, respectively. We want the three bars corresponding to this data to rest on the x axis, so the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access