@@ -121,9 +121,11 @@ void GameView::render() {
121121 DrawingGameVisitor visitor (*this );
122122 model.accept (visitor);
123123
124+ // Render UI items
124125 for (auto it = viewElements.rbegin (); it != viewElements.rend (); it++) {
125126 it->second ->render ();
126127 }
128+ // Render clicked points
127129 for (auto & it : pointsOfInterest) {
128130 highlightPoint (it);
129131 }
@@ -146,20 +148,34 @@ void GameView::render() {
146148 glFlush ();
147149}
148150
151+ /* *
152+ * Pushes a coordinate into the points of interest history to be highlighted on screen
153+ * @param coord the point of interest to add
154+ */
149155void GameView::addPointOfInterest (ScreenCoordinate coord){
150156 pointsOfInterest.push_back (coord);
151157}
152158
159+ /* *
160+ * Clears the points of interest history, so those points will no longer be highlighted.
161+ */
153162void GameView::clearPointsOfInterest (){
154163 pointsOfInterest.clear ();
155164}
156165
166+ /* *
167+ * Highlights a coordinate with a small blue square
168+ * @param coord the coordinate to be highlighted on screen
169+ */
157170void GameView::highlightPoint (ScreenCoordinate & coord){
158171 std::tuple<float ,float ,float > color (0 .f ,0 .f ,1 .f );
159172 renderRectangle ({coord.first - .01 , coord.second - .01 }, {coord.first + .01 , coord.second + .01 }, color);
160173}
161174
162-
175+ /* *
176+ * Sets the text to be displayed at the top of the screen
177+ * @param newText the new text to be displayed on screen. An empty string will cause a crash.
178+ */
163179void GameView::setControlStateText (std::string newText){
164180 controlStateText = newText;
165181}
0 commit comments