| 55 | } |
| 56 | |
| 57 | void BasicApp::draw() |
| 58 | { |
| 59 | // Clear the contents of the window. This call will clear |
| 60 | // both the color and depth buffers. |
| 61 | gl::clear( Color::gray( 0.1f ) ); |
| 62 | |
| 63 | // Set the current draw color to orange by setting values for |
| 64 | // red, green and blue directly. Values range from 0 to 1. |
| 65 | // See also: gl::ScopedColor |
| 66 | gl::color( 1.0f, 0.5f, 0.25f ); |
| 67 | |
| 68 | // We're going to draw a line through all the points in the list |
| 69 | // using a few convenience functions: 'begin' will tell OpenGL to |
| 70 | // start constructing a line strip, 'vertex' will add a point to the |
| 71 | // line strip and 'end' will execute the draw calls on the GPU. |
| 72 | gl::begin( GL_LINE_STRIP ); |
| 73 | for( const vec2 &point : mPoints ) { |
| 74 | gl::vertex( point ); |
| 75 | } |
| 76 | gl::end(); |
| 77 | } |
| 78 | |
| 79 | // This line tells Cinder to actually create and run the application. |
| 80 | CINDER_APP( BasicApp, RendererGl, prepareSettings ) |