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

Method drawInfo

samples/FallingGears/src/FallingGearsApp.cpp:216–233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216void FallingGearsApp::drawInfo()
217{
218 gl::ScopedBlendAlpha blendScope;
219
220 TextLayout layout;
221 layout.setFont( Font( "Arial", 14 ) );
222 layout.setColor( Color( 1, 1, 0 ) );
223
224 layout.addLine( string( "gears: " + to_string( mScene.getGears().size() ) ) );
225 layout.addLine( string( "synths: " + to_string( mAudio.getNumUsedSynths() ) + " / " + to_string( mAudio.getNumTotalSynths() ) ) );
226
227 auto tex = gl::Texture::create( layout.render( true ) );
228
229 vec2 offset( getWindowWidth() - tex->getWidth() - 16, 10 );
230 gl::color( Color::white() );
231 gl::draw( tex, offset );
232
233}
234
235CINDER_APP( FallingGearsApp, RendererGl( RendererGl::Options().msaa( 8 ) ), []( App::Settings *settings ) {
236 settings->setWindowSize( 1200, 800 );

Callers

nothing calls this directly

Calls 15

stringFunction · 0.85
getWindowWidthFunction · 0.85
whiteFunction · 0.85
addLineMethod · 0.80
getNumUsedSynthsMethod · 0.80
getNumTotalSynthsMethod · 0.80
FontFunction · 0.50
ColorFunction · 0.50
to_stringFunction · 0.50
createFunction · 0.50
colorFunction · 0.50
drawFunction · 0.50

Tested by

no test coverage detected