annotate Renderer/Test/SgRootChange.cc @ 693:fc0227b5cb5a

debug , aligned light_xyz
author hiroki@localhost.localdomain
date Tue, 08 Dec 2009 19:44:20 +0900
parents 9d1bcc07734b
children aaaa0baeab89
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
656
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
1 #include <math.h>
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
2 #include <stdlib.h>
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
3 #include "SceneGraphRoot.h"
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
4 #include "MainLoop.h"
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
5 #include "SgRootChange.h"
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
6
693
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
7 static void
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
8 ball_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
9 {
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
10 printf("test\n");
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
11 }
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
12
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
13 static void
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
14 ball_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h,
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
15 SceneGraphPtr tree)
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
16 {
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
17 printf("collision\n");
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
18 }
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
19
656
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
20 // prototype
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
21 MainLoopPtr
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
22 SgRootChange::init(Viewer *sgroot, int screen_w, int screen_h)
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
23 {
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
24 return sgroot;
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
25 }
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
26
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
27 MainLoopPtr
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
28 SgRootChange::init_only_sg(SgChange *sgroot, int screen_w, int screen_h)
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
29 {
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
30 SceneGraphPtr ball;
691
9d1bcc07734b Test/SgRootChange not work
hiroki@localhost.localdomain
parents: 656
diff changeset
31 sgroot->createFromXMLfile("xml_file/Ball.xml");
9d1bcc07734b Test/SgRootChange not work
hiroki@localhost.localdomain
parents: 656
diff changeset
32 ball = sgroot->createSceneGraph("Ball");
693
fc0227b5cb5a debug , aligned light_xyz
hiroki@localhost.localdomain
parents: 691
diff changeset
33 ball->set_move_collision(ball_move, ball_collision);
691
9d1bcc07734b Test/SgRootChange not work
hiroki@localhost.localdomain
parents: 656
diff changeset
34 sgroot->setSceneData(ball);
656
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
35
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
36 return sgroot;
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
37 }
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
38
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
39 extern Application *
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
40 application() {
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
41 return new SgRootChange();
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
42 }
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
43
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
44 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
45
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
46 extern int sg_init(TaskManager *manager, int argc, char *argv[]);
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
47 extern void task_initialize();
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
48 static void TMend(TaskManager *manager);
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
49
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
50 int
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
51 TMmain(TaskManager *manager, int argc, char *argv[])
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
52 {
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
53 task_initialize();
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
54 manager->set_TMend(TMend);
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
55 return sg_init(manager, argc, argv);
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
56
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
57 }
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
58
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
59 void
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
60 TMend(TaskManager *manager)
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
61 {
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
62 printf("test_nogl end\n");
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
63 }
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
64
d0b8860c17f8 remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
65 /* end */