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

Method draw

samples/_svg/EuroMap/src/EuroMapApp.cpp:68–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void EuroMapApp::draw()
69{
70 gl::clear();
71 gl::enableAlphaBlending();
72 glLineWidth( 2.0f );
73
74 if( mMapTex ) {
75 gl::color( Color::white() );
76 gl::draw( mMapTex );
77 }
78
79 if( mCurrentCountry ) {
80 // draw the outline
81 gl::color( 1, 0.5f, 0.25f, mCurrentCountryAlpha );
82 gl::draw( mCurrentCountry->getShapeAbsolute() );
83
84 // draw the name
85 string countryName = mCurrentCountry->getId();
86 vec2 pos = mCurrentCountry->getBoundingBoxAbsolute().getCenter();
87 pos.x -= mFont->measureString( countryName ).x / 2;
88
89 gl::color( ColorA( 1, 1, 1, mCurrentCountryAlpha ) );
90 mFont->drawString( countryName, pos + vec2( 2, 2 ) );
91 gl::color( ColorA( 0, 0, 0, mCurrentCountryAlpha ) );
92 mFont->drawString( countryName, pos );
93 }
94}
95
96
97CINDER_APP( EuroMapApp, RendererGl, EuroMapApp::prepareSettings )

Callers

nothing calls this directly

Calls 7

enableAlphaBlendingFunction · 0.85
whiteFunction · 0.85
measureStringMethod · 0.80
drawStringMethod · 0.80
clearFunction · 0.50
colorFunction · 0.50
drawFunction · 0.50

Tested by

no test coverage detected