Mercurial > hg > forks > gldragon
comparison dmglrender.cpp @ 92:28dd29f3a65f
Remove DMSimpleRenderer::animate() and use direct time value in drawScene() etc.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 25 May 2021 00:44:40 +0300 |
parents | 4df8a7337e3e |
children | 50a69d327b4f |
comparison
equal
deleted
inserted
replaced
91:4df8a7337e3e | 92:28dd29f3a65f |
---|---|
424 | 424 |
425 glEnable(GL_DEPTH_TEST); | 425 glEnable(GL_DEPTH_TEST); |
426 glEnable(GL_LIGHTING); | 426 glEnable(GL_LIGHTING); |
427 | 427 |
428 // Draw models | 428 // Draw models |
429 glPushMatrix(); | |
430 glRotatef(time * 360.0, 0, 1, 0); | |
431 | |
429 for (const DMModel &model : scene.models) | 432 for (const DMModel &model : scene.models) |
430 { | 433 { |
431 glPushMatrix(); | 434 glPushMatrix(); |
432 drawModel(scene, model, time); | 435 drawModel(scene, model, time); |
433 glPopMatrix(); | 436 glPopMatrix(); |
434 } | 437 } |
438 | |
439 glPopMatrix(); | |
435 } | 440 } |
436 | 441 |
437 | 442 |
438 bool DMGLSimpleRenderer::setupLight(const int n, DMLight &light) | 443 bool DMGLSimpleRenderer::setupLight(const int n, DMLight &light) |
439 { | 444 { |
451 (void) camera; | 456 (void) camera; |
452 | 457 |
453 gluLookAt(0, 0.12, 0.24, 0, 0.12, 0, 0, 1, 0); | 458 gluLookAt(0, 0.12, 0.24, 0, 0.12, 0, 0, 1, 0); |
454 return true; | 459 return true; |
455 } | 460 } |
456 | |
457 | |
458 bool DMGLSimpleRenderer::animate(DMSimpleScene &scene, const float time) | |
459 { | |
460 (void) scene; | |
461 (void) time; | |
462 | |
463 glRotatef(2.0f, 0, 1, 0); | |
464 return true; | |
465 } |