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

Method drawScene

samples/_opengl/ShadowMapping/src/ShadowMappingApp.cpp:249–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249void ShadowMappingApp::drawScene( float spinAngle, const gl::GlslProgRef& shadowGlsl )
250{
251 {
252 gl::ScopedColor red( Color( 0.98f, 0.22f, 0.10f ));
253 gl::ScopedModelMatrix push;
254 gl::scale( vec3(4) );
255
256 if( shadowGlsl ) {
257 shadowGlsl->uniform( "uIsTeapot", false );
258 mSphereShadowed->draw();
259 shadowGlsl->uniform( "uIsTeapot", true );
260 }
261 else {
262 mSphere->draw();
263 }
264 }
265
266 {
267 gl::ScopedColor white( Color( 0.90f, 0.97f, 0.97f ) );
268 for ( const auto& transform : mTransforms ) {
269 gl::ScopedModelMatrix push;
270 gl::scale( vec3(0.25) );
271 gl::multModelMatrix( rotate( spinAngle, transform.second ) * transform.first );
272 if( shadowGlsl )
273 mTeapotShadowed->draw();
274 else
275 mTeapot->draw();
276 }
277 }
278}
279
280void ShadowMappingApp::draw()
281{

Callers

nothing calls this directly

Calls 6

multModelMatrixFunction · 0.85
uniformMethod · 0.80
ColorFunction · 0.50
scaleFunction · 0.50
rotateFunction · 0.50
drawMethod · 0.45

Tested by

no test coverage detected