The following are the steps to draw a line between two mouse clicks:
- Initialize GLUT, define the size of the top-level window, and display the window.
- Define a drawLine callback function that draws a line if any mouse click event occurs.
- In the drawLine function, the clear values for the clear buffers are specified.
- The glutSwapBuffers() function is invoked to swap the front and back buffers to display any frame that is rendered in the back buffer and is ready to be displayed.
- The glutReshapeFunc function is invoked to specify the reshape callback function that will be auto-invoked whenever the window is reshaped to redraw the lines.
- Because the vertices of the line are rendered on the basis of the current state of the ...