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

Method draw

samples/CairoBasic/src/CairoBasicApp.cpp:117–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void 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 )
137CINDER_APP( CairoBasicApp, RendererGl )

Callers 1

renderSceneMethod · 0.45

Calls 6

getWindowWidthFunction · 0.85
getWindowHeightFunction · 0.85
createWindowSurfaceFunction · 0.85
createFunction · 0.50
drawFunction · 0.50
getSurfaceMethod · 0.45

Tested by

no test coverage detected