Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/SgChange.cc @ 757:5238f3e854fc
Test/create_task , create SPE task from application.
author | hiroki |
---|---|
date | Fri, 29 Jan 2010 14:34:30 +0900 |
parents | 5d23ffea34e3 |
children | bb47827c04c1 |
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 post2runMove(SchedTask *s, void *viewer, void *s1); | |
21 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
|
22 |
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 /* measure for FPS (Frame Per Second) */ |
748 | 24 extern int start_time; |
25 extern int this_time; | |
26 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
|
27 |
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 /* Data Pack sent to Other CPUs (ex. SPE) */ |
748 | 29 extern SceneGraphPack *sgpack; |
30 extern PolygonPack *ppack; | |
31 extern SpanPackPtr spackList; | |
32 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
|
33 |
748 | 34 extern int spackList_length; |
35 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
|
36 |
748 | 37 void |
38 SgChange::run_init() | |
39 { | |
40 int width = viewer->width; | |
41 int height = viewer->height; | |
42 sgroot_A = new SceneGraphRoot(width, height); | |
43 sgroot_A->tmanager = viewer->manager; | |
44 sgroot_B = new SceneGraphRoot(width, height); | |
45 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
|
46 } |
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 |
748 | 48 HTaskPtr |
49 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
|
50 { |
748 | 51 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
|
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 |
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 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
|
55 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
|
56 { |
748 | 57 HTaskPtr task_next = initLoop(); |
58 | |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
59 //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
|
60 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
|
61 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
|
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 |
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 static void |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
65 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
|
66 { |
748 | 67 SgChange *sgchange = (SgChange*)sgchange_; |
68 HTaskPtr task_next = sgchange->manager->create_task(Dummy); | |
69 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
|
70 |
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 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
|
72 } |
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
|
73 |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
74 static void |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
75 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
|
76 { |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
77 SgChange *sgchange = (SgChange*)sgchange_; |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
78 HTaskPtr task_next = sgchange->manager->create_task(Dummy); |
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 /* |
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 SceneGraphRoot *tmp; |
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 tmp = sgroot_A; |
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 sgroot_A = sgroot_B; |
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 sgroot_B = tmp; |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
93 */ |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
94 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
|
95 } |
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 |
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
|
97 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
|
98 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
|
99 { |
748 | 100 viewer->dev->clear_screen(); |
101 | |
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
|
102 bool quit_flg; |
748 | 103 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
|
104 if (quit_flg == true) { |
748 | 105 this_time = viewer->get_ticks(); |
106 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
|
107 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
|
108 } |
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
|
109 |
748 | 110 viewer->dev->clean_pixels(); |
111 | |
112 for (int i = 1; i <= spackList_length; i++) { | |
113 spackList[i-1].reinit(i*split_screen_h); | |
114 } | |
115 | |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
116 /* |
748 | 117 sgroot_A->updateControllerState(); |
118 sgroot_A->allExecute(viewer->width, viewer->height); | |
119 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
|
120 */ |
748 | 121 |
122 HTaskPtr loop_task = manager->create_task(Dummy); | |
123 loop_task->set_post(post2runLoop, (void *)this, 0); | |
124 | |
125 HTaskPtr draw_task = manager->create_task(Dummy); | |
126 draw_task->set_post(post2rendering, (void *)this, 0); | |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
127 |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
128 #if 0 |
748 | 129 HTaskPtr move_task = manager->create_task(Dummy); |
130 move_task->set_post(post2runMove, (void *)this, 0); | |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
131 #else |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
132 HTaskPtr move_task = manager->create_task(RunMove); |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
133 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
|
134 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
|
135 move_task->set_param(2, viewer->height); |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
136 #endif |
748 | 137 |
138 HTaskPtr dummy_task = manager->create_task(Dummy); | |
139 | |
140 draw_finish = dummy_task; | |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
141 |
748 | 142 loop_task->wait_for(draw_finish); |
143 loop_task->wait_for(move_task); | |
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
|
144 |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
145 draw_task->spawn(); |
748 | 146 move_task->spawn(); |
147 loop_task->spawn(); | |
148 } | |
149 | |
150 static void | |
151 post2runMove(SchedTask *s, void *viewer_, void *arg) | |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
152 { |
748 | 153 SgChange *viewer = (SgChange *)viewer_; |
154 HTaskPtr task_next = viewer->manager->create_task(Dummy); | |
155 viewer->run_move(task_next); | |
156 } | |
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
|
157 |
748 | 158 void |
159 SgChange::run_move(HTaskPtr task_next) | |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
160 { |
748 | 161 sgroot_A->updateControllerState(); |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
162 sgroot_A->allExecute(viewer->width, viewer->height); |
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
163 viewer->light_xyz_stock = sgroot_A->getLightVector(); |
748 | 164 } |
165 | |
166 static void | |
167 post2rendering(SchedTask *s, void *sgchange_, void *arg) | |
168 { | |
169 SgChange *sgchange = (SgChange *)sgchange_; | |
170 HTaskPtr task_next = sgchange->manager->create_task(Dummy); | |
171 sgchange->rendering(task_next); | |
172 | |
173 } | |
174 | |
175 void | |
176 SgChange::rendering(HTaskPtr task_next) | |
177 { | |
752
5d23ffea34e3
rendering, move_coll parallel running
hiroki@henri.cr.ie.u-ryukyu.ac.jp
parents:
748
diff
changeset
|
178 viewer->common_rendering(task_next, sgroot_B); |
748 | 179 |
180 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
|
181 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
|
182 } |
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
|
183 |
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
|
184 |
748 | 185 static void |
186 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
|
187 { |
748 | 188 SgChange *sgchange = (SgChange *)sgchange_; |
189 HTaskPtr task_next = sgchange->manager->create_task(Dummy); | |
190 sgchange->run_draw(task_next); | |
191 } | |
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
|
192 |
748 | 193 void |
194 SgChange::run_draw(HTaskPtr task_next) // 引数に post2runLoop を入れるようにする | |
195 { | |
196 viewer->common_draw(task_next); | |
197 | |
198 this->draw_finish->wait_for(task_next); | |
199 task_next->spawn(); | |
200 this->draw_finish->spawn(); | |
201 | |
202 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
|
203 } |
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
|
204 |
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
|
205 /* end */ |