comparison Renderer/Test/universe.cc @ 656:d0b8860c17f8

remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
author hiroki@henri.cr.ie.u-ryukyu.ac.jp
date Wed, 25 Nov 2009 21:56:14 +0900
parents b21a013051a2
children 4dc02d3e98bb
comparison
equal deleted inserted replaced
646:ffcc25c7c566 656:d0b8860c17f8
1 #include <stdlib.h> 1 #include <stdlib.h>
2 #include "SceneGraphRoot.h" 2 #include "SceneGraphRoot.h"
3 #include "universe.h" 3 #include "universe.h"
4 4
5 static void 5 static void
6 earth_collision(SceneGraphPtr node, int screen_w, int screen_h, 6 earth_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h,
7 SceneGraphPtr tree) 7 SceneGraphPtr tree)
8 { 8 {
9 } 9 }
10 10
11 static void 11 static void
12 moon_collision(SceneGraphPtr node, int screen_w, int screen_h, 12 moon_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h,
13 SceneGraphPtr tree) 13 SceneGraphPtr tree)
14 { 14 {
15 } 15 }
16 16
17 static void 17 static void
18 moon_move(SceneGraphPtr node, int screen_w, int screen_h) 18 moon_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
19 { 19 {
20 node->angle[0] += 3.0f; 20 node->angle[0] += 3.0f;
21 } 21 }
22 22
23 23
24 static void 24 static void
25 earth_move(SceneGraphPtr node, int screen_w, int screen_h) 25 earth_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
26 { 26 {
27 node->angle[1] += 1.0f; 27 node->angle[1] += 1.0f;
28 if (node->angle[1] > 360.0f) { 28 if (node->angle[1] > 360.0f) {
29 node->angle[1] = 0.0f; 29 node->angle[1] = 0.0f;
30 } 30 }
66 // このとき、ユーザーが記述した SceneGraph の root を渡す。 66 // このとき、ユーザーが記述した SceneGraph の root を渡す。
67 sgroot->setSceneData(earth); 67 sgroot->setSceneData(earth);
68 return sgroot; 68 return sgroot;
69 } 69 }
70 70
71 MainLoopPtr
72 universe::init_only_sg(SgChange *sgroot, int screen_w, int screen_h)
73 {
74 return sgroot;
75 }
71 76
72 extern Application * 77 extern Application *
73 application() { 78 application() {
74 return new universe(); 79 return new universe();
75 } 80 }