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

Method draw

samples/BezierPathIteration/src/BezierPathIterationApp.cpp:79–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void BezierPathIterationApp::draw()
80{
81 // clear out the window with black
82 gl::clear( Color( 0, 0, 0 ) );
83
84 // center and scale the drawing
85 gl::setMatricesWindow( getWindowSize() );
86 gl::translate( mWindowOffset );
87 gl::scale( mWindowScale );
88
89 gl::color( Color( 1.0f, 0.5f, 0.25f ) );
90 for( auto &pathIt : mPathIters ) {
91 pathIt.mCurrentDistance += 3.0f; // move 3 units along the path
92 float newTime = pathIt.mPathCache.calcTimeForDistance( pathIt.mCurrentDistance );
93 vec2 pos = pathIt.mPathCache.getPosition( newTime );
94
95 gl::drawLine( pathIt.mLastPos, pos );
96 pathIt.mLastPos = pos;
97 }
98}
99
100CINDER_APP( BezierPathIterationApp, RendererGl )

Callers

nothing calls this directly

Calls 10

setMatricesWindowFunction · 0.85
calcTimeForDistanceMethod · 0.80
clearFunction · 0.50
ColorFunction · 0.50
getWindowSizeFunction · 0.50
translateFunction · 0.50
scaleFunction · 0.50
colorFunction · 0.50
drawLineFunction · 0.50
getPositionMethod · 0.45

Tested by

no test coverage detected