Reference no: EM132169207
Using a graphics software library and programming language, design and implement a simple menu driven program that permits users to select an option for specifying and rendering a graphic primitive, then looping back to repeat or exiting the program.
Tasks:
To program a graphics program the first thing to consider is the display window (or canvas) itself. This is specified and implemented using library functions.
The primary task is described in terms of a menu that permits users to select the option to exit the program, or repeatedly perform one of the following sub-tasks:
(a) Exit the program
i. Close the drawing window and clean up
(b) Draw points with specified colour
Specify number of points
Specify coordinates and colour
(c) Draw a line using point draw and Bresenham's line algorithm
i. Specify end-points and colour
(d) Draw a filled circle using point draw and Bresenham's circle algorithm.
i. Specify coordinates of the centre, the radius and the colour
(e) After each menu selection is completed there is a loop back necessitating a clearing of the canvas.