| 115 | } |
| 116 | |
| 117 | void CairoBasicApp::draw() |
| 118 | { |
| 119 | #if defined( CINDER_LINUX ) || defined( CINDER_MAC ) |
| 120 | // On Linux/Mac, render to an image surface and then draw to window |
| 121 | cairo::SurfaceImage surface( getWindowWidth(), getWindowHeight(), true ); |
| 122 | cairo::Context ctx( surface ); |
| 123 | renderScene( ctx ); |
| 124 | |
| 125 | // Convert to Cinder surface and draw to window |
| 126 | Surface8u cinderSurface = surface.getSurface(); |
| 127 | auto tex = gl::Texture2d::create( cinderSurface ); |
| 128 | gl::draw( tex ); |
| 129 | #else |
| 130 | // render the scene straight to the window |
| 131 | cairo::Context ctx( cairo::createWindowSurface() ); |
| 132 | renderScene( ctx ); |
| 133 | #endif |
| 134 | } |
| 135 | |
| 136 | #if defined( CINDER_LINUX ) || defined( CINDER_MAC ) |
| 137 | CINDER_APP( CairoBasicApp, RendererGl ) |
no test coverage detected