Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/SgChange.cc @ 760:24a37fe8419a
first of all commit, not work Rendering/Test/create_task
author | hiroki |
---|---|
date | Thu, 04 Feb 2010 14:46:09 +0900 |
parents | bb47827c04c1 |
children | 87390c99c900 |
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 <SDL.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 "SgChange.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 "viewer_types.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 "SceneGraph.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 "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
|
6 #include "scene_graph_pack.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
|
7 #include "sys.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
|
8 #include "Func.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
|
9 #include "error.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
|
10 #include "TaskManager.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
|
11 #include <wchar.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
|
12 #include "Pad.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
|
13 #include "Application.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
|
14 #include "lindaapi.h" |
748 | 15 #include "global_alloc.h" |
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
|
16 |
748 | 17 static void post2runLoop(SchedTask *s, void *viewer, void *s1); |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
18 static void post2run(SchedTask *s, void *viewer, void *s1); |
748 | 19 static void post2runDraw(SchedTask *s, void *viewer, void *s1); |
20 static void post2rendering(SchedTask *s, void *viewer, void *s1); | |
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
|
21 |
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 /* measure for FPS (Frame Per Second) */ |
748 | 23 extern int start_time; |
24 extern int this_time; | |
25 extern int frames; | |
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
|
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 /* Data Pack sent to Other CPUs (ex. SPE) */ |
748 | 28 extern SceneGraphPack *sgpack; |
29 extern PolygonPack *ppack; | |
30 extern SpanPackPtr spackList; | |
31 extern SpanPackPtr *spackList_ptr; | |
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
|
32 |
748 | 33 extern int spackList_length; |
34 extern int spackList_length_align; | |
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 |
748 | 36 void |
37 SgChange::run_init() | |
38 { | |
39 int width = viewer->width; | |
40 int height = viewer->height; | |
41 sgroot_A = new SceneGraphRoot(width, height); | |
42 sgroot_A->tmanager = viewer->manager; | |
43 sgroot_B = new SceneGraphRoot(width, height); | |
44 sgroot_B->tmanager = viewer->manager; | |
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
|
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 |
748 | 47 HTaskPtr |
48 SgChange::initLoop() | |
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
|
49 { |
748 | 50 return viewer->initLoop(); |
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
|
51 } |
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 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
|
54 SgChange::mainLoop() |
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 { |
748 | 56 HTaskPtr task_next = initLoop(); |
57 | |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
58 //task_next->set_post(&post2runLoop, (void *)this, 0); |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
59 task_next->set_post(&post2run, (void *)this, 0); |
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
|
60 task_next->spawn(); |
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 |
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 static void |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
64 post2run(SchedTask *s, void *sgchange_, void *arg) |
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
|
65 { |
748 | 66 SgChange *sgchange = (SgChange*)sgchange_; |
67 HTaskPtr task_next = sgchange->manager->create_task(Dummy); | |
68 sgchange->run_loop(task_next); | |
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
|
69 |
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
|
70 psx_sync_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
|
71 } |
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
|
72 |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
73 static void |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
74 post2runLoop(SchedTask *s, void *sgchange_, void *arg) |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
75 { |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
76 SgChange *sgchange = (SgChange*)sgchange_; |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
77 HTaskPtr task_next = sgchange->manager->create_task(Dummy); |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
78 sgchange->viewer->light_xyz_stock = sgchange->sgroot_A->getLightVector(); |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
79 sgchange->pass_draw_tree(); |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
80 sgchange->run_loop(task_next); |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
81 |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
82 psx_sync_n(); |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
83 } |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
84 |
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
|
85 void |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
86 SgChange::pass_draw_tree() |
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
|
87 { |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
88 sgroot_B->sg_draw_tree = sgroot_A->sg_exec_tree; |
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
|
89 } |
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
|
90 |
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
|
91 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
|
92 SgChange::run_loop(HTaskPtr task_next) |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
93 { |
748 | 94 viewer->dev->clear_screen(); |
95 | |
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
|
96 bool quit_flg; |
748 | 97 quit_flg = viewer->quit_check(); |
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
|
98 if (quit_flg == true) { |
748 | 99 this_time = viewer->get_ticks(); |
100 viewer->run_finish(); | |
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
|
101 return; |
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
|
102 } |
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
|
103 |
748 | 104 viewer->dev->clean_pixels(); |
105 | |
106 for (int i = 1; i <= spackList_length; i++) { | |
107 spackList[i-1].reinit(i*split_screen_h); | |
108 } | |
109 | |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
110 sgroot_A->updateControllerState(); |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
111 /* |
748 | 112 sgroot_A->updateControllerState(); |
113 sgroot_A->allExecute(viewer->width, viewer->height); | |
114 viewer->light_xyz_stock = sgroot_A->getLightVector(); | |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
115 */ |
748 | 116 |
117 HTaskPtr loop_task = manager->create_task(Dummy); | |
118 loop_task->set_post(post2runLoop, (void *)this, 0); | |
119 | |
120 HTaskPtr draw_task = manager->create_task(Dummy); | |
121 draw_task->set_post(post2rendering, (void *)this, 0); | |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
122 |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
123 /* |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
124 application 側で sgroot に task を生成登録する |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
125 引数を渡したりは後でやる。 |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
126 */ |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
127 sgroot_A->regist_execute(); |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
128 |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
129 //HTaskPtr move_task = manager->create_task(RunMove); |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
130 HTaskPtr move_task = manager->create_task(ExecMove); |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
131 move_task->set_param(0, (memaddr)this); |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
132 move_task->set_param(1, viewer->width); |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
133 move_task->set_param(2, viewer->height); |
748 | 134 |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
135 /* |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
136 TTaskPtr move_finish = manager->create_task(Dummy); |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
137 loop_task->wait_for(move_finish); |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
138 |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
139 move_finish は app の move_task の post_func で実行させてやる |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
140 */ |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
141 |
748 | 142 HTaskPtr dummy_task = manager->create_task(Dummy); |
143 | |
144 draw_finish = dummy_task; | |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
145 |
748 | 146 loop_task->wait_for(draw_finish); |
760
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
147 // move_task に wait_for ではなく sgroot_A->move_exec_task に wait_for するべき |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
148 // どこかで move_exec_task->spawn() しないとな |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
149 loop_task->wait_for(sgroot_A->move_exec_task); |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
150 |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
151 //loop_task->wait_for(move_task); |
24a37fe8419a
first of all commit, not work Rendering/Test/create_task
hiroki
parents:
759
diff
changeset
|
152 |
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
|
153 |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
154 draw_task->spawn(); |
759 | 155 // この時点で app の task_id を知っていないとダメか |
748 | 156 move_task->spawn(); |
157 loop_task->spawn(); | |
158 } | |
159 | |
160 static void | |
161 post2rendering(SchedTask *s, void *sgchange_, void *arg) | |
162 { | |
163 SgChange *sgchange = (SgChange *)sgchange_; | |
164 HTaskPtr task_next = sgchange->manager->create_task(Dummy); | |
165 sgchange->rendering(task_next); | |
166 | |
167 } | |
168 | |
169 void | |
170 SgChange::rendering(HTaskPtr task_next) | |
171 { | |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
172 viewer->common_rendering(task_next, sgroot_B); |
748 | 173 |
174 task_next->set_post(post2runDraw, (void*)this, 0); | |
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
|
175 task_next->spawn(); |
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
|
176 } |
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
|
177 |
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
|
178 |
748 | 179 static void |
180 post2runDraw(SchedTask *s, void *sgchange_, void *arg) | |
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
|
181 { |
748 | 182 SgChange *sgchange = (SgChange *)sgchange_; |
183 HTaskPtr task_next = sgchange->manager->create_task(Dummy); | |
184 sgchange->run_draw(task_next); | |
185 } | |
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
|
186 |
748 | 187 void |
188 SgChange::run_draw(HTaskPtr task_next) // 引数に post2runLoop を入れるようにする | |
189 { | |
190 viewer->common_draw(task_next); | |
191 | |
192 this->draw_finish->wait_for(task_next); | |
193 task_next->spawn(); | |
194 this->draw_finish->spawn(); | |
195 | |
196 frames++; | |
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
|
197 } |
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
|
198 |
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
|
199 /* end */ |