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

Method draw

samples/ClipboardBasic/src/ClipboardBasicApp.cpp:31–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29}
30
31void ClipboardBasicApp::draw()
32{
33 gl::clear( Color( 0.5f, 0.5f, 0.5f ) );
34 gl::setMatricesWindow( getWindowSize() );
35 gl::enableAlphaBlending();
36
37 if( Clipboard::hasImage() ) {
38 auto img = Clipboard::getImage();
39 // be aware of a race condition here; the clipboard might have changed between hasImage() and getImage()
40 // so we test for null 'img'
41 if( img )
42 gl::draw( gl::Texture::create( img ) );
43 }
44 else if( Clipboard::hasString() )
45 gl::drawString( Clipboard::getString(), vec2( 0, getWindowCenter().y ) );
46 else
47 gl::drawString( "Clipboard contents unknown", vec2( 0, getWindowCenter().y ) );
48}
49
50CINDER_APP( ClipboardBasicApp, RendererGl )

Callers

nothing calls this directly

Calls 10

setMatricesWindowFunction · 0.85
enableAlphaBlendingFunction · 0.85
drawStringFunction · 0.85
getStringFunction · 0.85
getWindowCenterFunction · 0.85
clearFunction · 0.50
ColorFunction · 0.50
getWindowSizeFunction · 0.50
drawFunction · 0.50
createFunction · 0.50

Tested by

no test coverage detected