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

Method draw

samples/EaseGallery/src/EaseGalleryApp.cpp:35–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33 }
34
35 void draw( float t ) const
36 {
37 // draw box and frame
38 gl::color( Color( 1.0f, 1.0f, 1.0f ) );
39 gl::drawSolidRect( mDrawRect );
40 gl::color( Color( 0.4f, 0.4f, 0.4f ) );
41 gl::drawStrokedRect( mDrawRect );
42 gl::color( Color::white() );
43 gl::draw( mLabelTex, mDrawRect.getCenter() - vec2(mLabelTex->getSize()) / 2.0f );
44
45 // draw graph
46 gl::color( ColorA( 0.25f, 0.5f, 1.0f, 0.5f ) );
47
48 gl::begin( GL_LINE_STRIP );
49 for( float x = 0; x < mDrawRect.getWidth(); x += 0.25f ) {
50 float y = 1.0f - mFn( x / mDrawRect.getWidth() );
51 gl::vertex( vec2( x, y * mDrawRect.getHeight() ) + mDrawRect.getUpperLeft() );
52 }
53 gl::end();
54
55 // draw animating circle
56 gl::color( Color( 1, 0.5f, 0.25f ) );
57 gl::drawSolidCircle( mDrawRect.getUpperLeft() + mFn( t ) * mDrawRect.getSize(), 5.0f );
58 }
59
60 std::function<float (float)> mFn;
61 Rectf mDrawRect;

Callers

nothing calls this directly

Calls 13

drawSolidRectFunction · 0.85
drawStrokedRectFunction · 0.85
whiteFunction · 0.85
drawSolidCircleFunction · 0.85
colorFunction · 0.50
ColorFunction · 0.50
drawFunction · 0.50
beginFunction · 0.50
vertexFunction · 0.50
endFunction · 0.50
getSizeMethod · 0.45
getWidthMethod · 0.45

Tested by

no test coverage detected