MCPcopy Create free account
hub / github.com/cinder/Cinder / draw

Method draw

samples/BasicApp/src/BasicApp.cpp:57–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57void 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.
80CINDER_APP( BasicApp, RendererGl, prepareSettings )

Callers

nothing calls this directly

Calls 6

grayFunction · 0.85
clearFunction · 0.50
colorFunction · 0.50
beginFunction · 0.50
vertexFunction · 0.50
endFunction · 0.50

Tested by

no test coverage detected