rayzor

view src/scene.cc @ 0:2a5340a6eee4

rayzor first commit
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 05 Apr 2014 08:46:27 +0300
parents
children a826bf0fb169
line source
1 #include "scene.h"
3 Scene::Scene()
4 {
5 name = 0;
6 }
8 Scene::~Scene()
9 {
10 clear();
11 }
13 void Scene::clear()
14 {
15 delete [] name;
17 size_t i;
18 for(i=0; i<objects.size(); i++) {
19 delete objects[i];
20 }
21 for(i=0; i<lights.size(); i++) {
22 delete lights[i];
23 }
24 for(i=0; i<cameras.size(); i++) {
25 delete cameras[i];
26 }
27 }
29 void Scene::set_name(const char *name)
30 {
31 delete [] this->name;
32 this->name = new char[strlen(name) + 1];
33 strcpy(this->name, name);
34 }
36 const char *Scene::get_name() const
37 {
38 return name ? name : "<unknown>";
39 }
41 void Scene::draw() const
42 {
43 }