| 29 | } |
| 30 | |
| 31 | void 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 | |
| 50 | CINDER_APP( ClipboardBasicApp, RendererGl ) |
nothing calls this directly
no test coverage detected