comparison Renderer/Test/untitled.cc @ 653:7a311860a76e draft

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 e112f38275d5
children 91e2c96be77b
comparison
equal deleted inserted replaced
646:9f9390b45f78 653:7a311860a76e
2 #include "SceneGraphRoot.h" 2 #include "SceneGraphRoot.h"
3 #include "untitled.h" 3 #include "untitled.h"
4 #include <math.h> 4 #include <math.h>
5 5
6 static void 6 static void
7 cubetest_collision(SceneGraphPtr node, int screen_w, int screen_h, 7 cubetest_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h,
8 SceneGraphPtr tree) 8 SceneGraphPtr tree)
9 { 9 {
10 } 10 }
11 11
12 static void 12 static void
13 test_collision(SceneGraphPtr node, int screen_w, int screen_h, 13 test_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h,
14 SceneGraphPtr tree) 14 SceneGraphPtr tree)
15 { 15 {
16 // test 16 // test
17 } 17 }
18 18
19 static void 19 static void
20 test_move(SceneGraphPtr node, int screen_w, int screen_h) 20 test_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
21 { 21 {
22 22
23 node->angle[0] += 10.0f; 23 node->angle[0] += 10.0f;
24 /* 24 /*
25 node->stack_xyz[0] = 2.0f; 25 node->stack_xyz[0] = 2.0f;
46 */ 46 */
47 47
48 } 48 }
49 49
50 static void 50 static void
51 cubetest_move(SceneGraphPtr node, int screen_w, int screen_h) 51 cubetest_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
52 { 52 {
53 node->angle[1] += 10.0f; 53 node->angle[1] += 10.0f;
54 if (node->angle[1] > 360.0f) { 54 if (node->angle[1] > 360.0f) {
55 node->angle[1] = 0.0f; 55 node->angle[1] = 0.0f;
56 } 56 }
146 // このとき、ユーザーが記述した SceneGraph の root を渡す。 146 // このとき、ユーザーが記述した SceneGraph の root を渡す。
147 sgroot->setSceneData(test00); 147 sgroot->setSceneData(test00);
148 return sgroot; 148 return sgroot;
149 } 149 }
150 150
151 MainLoopPtr
152 untitled::init_only_sg(SgChange *sgroot, int screen_w, int screen_h)
153 {
154 return sgroot;
155 }
156
151 extern Application * 157 extern Application *
152 application() { 158 application() {
153 return new untitled(); 159 return new untitled();
154 } 160 }
155 161