goat3dgfx
diff src/scene.cc @ 12:1868c5975f31
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 24 Nov 2013 18:18:38 +0200 |
parents | 1873dfd13f2d |
children | 25bf39105c82 |
line diff
1.1 --- a/src/scene.cc Sun Nov 24 14:00:14 2013 +0200 1.2 +++ b/src/scene.cc Sun Nov 24 18:18:38 2013 +0200 1.3 @@ -1,5 +1,6 @@ 1.4 #include "scene.h" 1.5 #include "opengl.h" 1.6 +#include "goat3d.h" 1.7 1.8 Scene::~Scene() 1.9 { 1.10 @@ -24,6 +25,31 @@ 1.11 curves.clear(); 1.12 } 1.13 1.14 +bool Scene::load(const char *fname) 1.15 +{ 1.16 + goat3d *goat = goat3d_create(); 1.17 + if(!goat) { 1.18 + return false; 1.19 + } 1.20 + if(goat3d_load(goat, fname) == -1) { 1.21 + return false; 1.22 + } 1.23 + 1.24 + int num_meshes = goat3d_get_mesh_count(goat); 1.25 + for(int i=0; i<num_meshes; i++) { 1.26 + goat3d_mesh *gmesh = goat3d_get_mesh(goat, i); 1.27 + // TODO cont... 1.28 + } 1.29 + 1.30 + goat3d_free(goat); 1.31 + return true; 1.32 +} 1.33 + 1.34 +bool Scene::save(const char *fname) const 1.35 +{ 1.36 + return false; // TODO 1.37 +} 1.38 + 1.39 void Scene::draw(long msec) const 1.40 { 1.41 for(size_t i=0; i<objects.size(); i++) {