This code draws a red triangle on screen. It first translates the drawing plane away from the viewer, then sets the color to red. It then begins drawing a polygon, specifying the vertices for a triangle with points at (-1,0), (0,1), and (1,0). It ends the polygon drawing and swaps the front and back buffers so the image is displayed on screen.
This code draws a red triangle on screen. It first translates the drawing plane away from the viewer, then sets the color to red. It then begins drawing a polygon, specifying the vertices for a triangle with points at (-1,0), (0,1), and (1,0). It ends the polygon drawing and swaps the front and back buffers so the image is displayed on screen.
This code draws a red triangle on screen. It first translates the drawing plane away from the viewer, then sets the color to red. It then begins drawing a polygon, specifying the vertices for a triangle with points at (-1,0), (0,1), and (1,0). It ends the polygon drawing and swaps the front and back buffers so the image is displayed on screen.