goat3dgfx
view src/scene.cc @ 9:25b911c7c35c
fixed some line endings
fixed the cubemap2.jpg file in examples/cubemap/data which was resized improperly causing seams...
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 18 Nov 2013 04:10:19 +0200 |
parents | |
children | 1868c5975f31 |
line source
1 #include "scene.h"
2 #include "opengl.h"
4 Scene::~Scene()
5 {
6 destroy();
7 }
9 void Scene::destroy()
10 {
11 for(size_t i=0; i<objects.size(); i++) {
12 delete objects[i];
13 }
14 objects.clear();
16 for(size_t i=0; i<meshes.size(); i++) {
17 delete meshes[i];
18 }
19 meshes.clear();
21 for(size_t i=0; i<curves.size(); i++) {
22 delete curves[i];
23 }
24 curves.clear();
25 }
27 void Scene::draw(long msec) const
28 {
29 for(size_t i=0; i<objects.size(); i++) {
30 objects[i]->draw(msec);
31 }
33 if(objects.empty()) {
34 printf("rendering meshes directly\n");
35 for(size_t i=0; i<meshes.size(); i++) {
36 meshes[i]->draw();
37 }
38 }
39 }