Reference no: EM131239200
Here is the specification for dragging out a line:
• Left mouse button (LMB) clicks define the center of the line.
• LMB drags out a line such that the line extends in two directions. The first direction extends from the center (LMB click) position toward the current mouse position. The second direction extends in the opposite direction from the first with exactly the same length.
• Right mouse button (RMB) click-drag moves the line such that the center of the line follows the current mouse position.
(a) Follow the steps outlined in Section 19.2.3 and design an event-driven programming solution for this specification.
(b) Implement your design with FLTK and OpenGL.
(c) Implement your design with MFC and Direct-3D.
Notice that in this case the useful application internal state information (the center position of the line) and the drawing presentation requirements (end points of the line) do not coincide exactly. When defining the application state, we should pay attention to what is the most important and convenient information to store in order to support the specified functionality.