changeset 29:e949a536a68d

*** empty log message ***
author gongo
date Mon, 11 Feb 2008 17:33:38 +0900
parents 243ee0a1fe6f
children bd5fc2e3f8c7
files TaskManager/Changelog TaskManager/Test/simple_render/scene_graph_pack.h TaskManager/Test/simple_render/update_sgp.cpp TaskManager/Test/simple_render/viewer.cpp
diffstat 4 files changed, 59 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Changelog	Mon Feb 11 13:32:30 2008 +0900
+++ b/TaskManager/Changelog	Mon Feb 11 17:33:38 2008 +0900
@@ -1,3 +1,12 @@
+2008-02-11  Wataru MIYAGUNI  <gongo@cr.ie.u-ryukyu.ac.jp>
+
+	* add: Test/simple_render
+	chiaki の DataPack を使った Cube の表示プログラム。
+	簡単に DataPack を TaskManager の scheduler (SpeManager) に渡して
+	処理してコピーして、を繰り返してるだけなんだけど
+	まあ動いてる気がするのでいいんじゃないでしょうか。
+
+	
 2008-02-10  Wataru MIYAGUNI  <gongo@cr.ie.u-ryukyu.ac.jp>
 
 	* tag: beta1
--- a/TaskManager/Test/simple_render/scene_graph_pack.h	Mon Feb 11 13:32:30 2008 +0900
+++ b/TaskManager/Test/simple_render/scene_graph_pack.h	Mon Feb 11 17:33:38 2008 +0900
@@ -20,7 +20,7 @@
   int move, interaction;
   //int op[32]; // push pop shift   =>   enum
   int pn;
-}SceneGraphNode;
+} SceneGraphNode, *SceneGraphNodePtr;
 
 typedef struct SceneGraphInfo {
   int size;
--- a/TaskManager/Test/simple_render/update_sgp.cpp	Mon Feb 11 13:32:30 2008 +0900
+++ b/TaskManager/Test/simple_render/update_sgp.cpp	Mon Feb 11 17:33:38 2008 +0900
@@ -64,17 +64,26 @@
 int
 update_sgp(SceneGraphPack *_sgp, SceneGraphPack *sgp)
 {
+    SceneGraphNodePtr node;
+    float y_angle;
+
     for (int i = 0; i < sgp->info.size; i++) {
 	//(*my_func[node->move])(node);
 	//(*my_func[node->interaction])(node, sgp);
-	
-	if (sgp->node[i].pn != -1) {
-	    get_matrix(sgp->node[i].translation,
-		       sgp->node[i].angle, sgp->node[i].obj_pos,
-		       sgp->node[sgp->node[i].pn].translation);
+
+	node = &sgp->node[i];
+#if 0
+	node->obj_pos[0] += 0.5f;
+	node->obj_pos[1] += 0.5f;
+	node->obj_pos[2] += 0.5f;
+#endif
+	if (node->pn != -1) {
+	    get_matrix(node->translation,
+		       node->angle, node->obj_pos,
+		       sgp->node[node->pn].translation);
 	} else {
-	    get_matrix(sgp->node[i].translation,
-		       sgp->node[i].angle, sgp->node[i].obj_pos,
+	    get_matrix(node->translation,
+		       node->angle, node->obj_pos,
 		       NULL);
 	}
     }
--- a/TaskManager/Test/simple_render/viewer.cpp	Mon Feb 11 13:32:30 2008 +0900
+++ b/TaskManager/Test/simple_render/viewer.cpp	Mon Feb 11 17:33:38 2008 +0900
@@ -325,8 +325,10 @@
     int frames = 0;
     int start_time, this_time;
 
+    HTaskPtr task_create_sgp = NULL;
     HTaskPtr task_update_sgp = NULL;
     HTaskPtr task_create_pp = NULL;
+    int fd_create_sgp;
     int fd_update_sgp;
     int fd_create_pp;
 
@@ -360,7 +362,7 @@
     */
 
     SceneGraphPack *sgp = new SceneGraphPack;
-    create_sgp(sgp,p);
+    //create_sgp(sgp,p);
 
     PolygonPack *pp = new PolygonPack;
 
@@ -410,31 +412,42 @@
 	x += 0.5;
 	y += 0.5;
 	z += 0.5;
-	//p->xyz[0] = x;
-	//p->xyz[1] = y;
-	//p->xyz[2] = z;
-	//p->tree_draw();
+	p->xyz[0] = x;
+	p->xyz[1] = y;
+	p->xyz[2] = z;
+	p->tree_draw();
 
-
-#if 0
+#if 1
+	create_sgp(sgp, p);
 	update_sgp(sgp, sgp);
 	create_pp(pp, sgp);
 #else
+	fd_create_sgp = manager->open("CreateSGP");
 	fd_update_sgp = manager->open("UpdateSGP");
-	fd_create_pp = manager->open("CreatePP");
+	fd_create_pp  = manager->open("CreatePP");
 
-	task_update_sgp = manager->create_task(fd_update_sgp,
-					       sizeof(SceneGraphPack),
-					       (unsigned int)sgp,
-					       (unsigned int)sgp,
-					       NULL);
-      
-	task_create_pp = manager->create_task(fd_create_pp,
-					      sizeof(SceneGraphPack),
-					      (unsigned int)sgp,
-					      (unsigned int)pp,
-					      NULL);
-	//manager->set_task_depend(task_update_sgp, task_create_pp);
+	task_create_sgp =
+	    manager->create_task(fd_create_sgp,
+				 sizeof(Polygon),
+				 (unsigned int)p,
+				 (unsigned int)sgp,
+				 NULL);
+	task_update_sgp =
+	    manager->create_task(fd_update_sgp,
+				 sizeof(SceneGraphPack),
+				 (unsigned int)sgp,
+				 (unsigned int)sgp,
+				 NULL);      
+	task_create_pp =
+	    manager->create_task(fd_create_pp,
+				 sizeof(SceneGraphPack),
+				 (unsigned int)sgp,
+				 (unsigned int)pp,
+				 NULL);
+
+	manager->set_task_depend(task_create_sgp, task_update_sgp);
+	manager->set_task_depend(task_create_sgp, task_create_pp);
+	manager->spawn_task(task_create_sgp);
 	manager->spawn_task(task_update_sgp);
 	manager->spawn_task(task_create_pp);