#include #include "CMUgraphicsLib\CMUgraphics.h" #include "waitnclear.h" /** * This file contains the implementation of the WaitNClear function * from the demo program in the CMU Graphics Library, written * at the Carnegie Mellon University School of Computer Science and * available from Mark Stehlik's Advanced Placement web page: * http://www.cs.cmu.edu/~mjs/ * */ void WaitNClear(window &inputWindow) { // Mouse X and Y values: WaitMouseClick will want to // tell us what the coordinates of the mouse click was. int mX, mY; // Print the instructions inputWindow.SetPen(BLACK); inputWindow.SetFont(16, BOLD, SWISS); inputWindow.DrawString(inputWindow.GetWidth()/2 - 100, inputWindow.GetHeight() - 25, "Click mouse to continue..."); // Flush the mouse queue inputWindow.FlushMouseQueue(); // Ignore return value since we don't care what // type of click it was inputWindow.WaitMouseClick(mX, mY); // Set the brush and pen white so we can clear the // background inputWindow.SetPen(WHITE, 0); inputWindow.SetBrush(WHITE); // Draw a rectangle that covers the entire window inputWindow.DrawRectangle(0, 0, inputWindow.GetWidth(), inputWindow.GetHeight()); }