cloth
diff src/main.cc @ 3:28a31079dcdf
disc
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 04 Jan 2016 10:52:15 +0200 |
parents | 92983e143a03 |
children |
line diff
1.1 --- a/src/main.cc Tue Feb 12 00:23:40 2013 +0200 1.2 +++ b/src/main.cc Mon Jan 04 10:52:15 2016 +0200 1.3 @@ -1,6 +1,11 @@ 1.4 #include <stdio.h> 1.5 #include <stdlib.h> 1.6 +#include <vector> 1.7 #include "opengl.h" 1.8 +#include "plane.h" 1.9 +#include "disc.h" 1.10 +#include "particle.h" 1.11 +#include "simworld.h" 1.12 1.13 static bool init(); 1.14 static void cleanup(); 1.15 @@ -15,6 +20,8 @@ 1.16 1.17 static bool moving_cloth; 1.18 1.19 +static SimWorld simworld; 1.20 + 1.21 1.22 int main(int argc, char **argv) 1.23 { 1.24 @@ -49,6 +56,10 @@ 1.25 glEnable(GL_DEPTH_TEST); 1.26 glEnable(GL_CULL_FACE); 1.27 1.28 + Disc *disc = new Disc; 1.29 + disc->normal = Vector3(0, 1, 0); 1.30 + simworld.add_object(disc); 1.31 + 1.32 return true; 1.33 } 1.34 1.35 @@ -68,7 +79,10 @@ 1.36 1.37 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); 1.38 1.39 - glutSolidTeapot(1.0); 1.40 + for(int i=0; i<simworld.get_object_count(); i++) { 1.41 + Object *obj = simworld.get_object(i); 1.42 + obj->draw(); 1.43 + } 1.44 1.45 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); 1.46