diff Renderer/Engine/viewer.cc @ 1097:185f025f7ce5 draft

not yet done
author yutaka@localhost.localdomain
date Sat, 25 Dec 2010 23:12:18 +0900
parents d18b605e431f
children 25d3cfb85439
line wrap: on
line diff
--- a/Renderer/Engine/viewer.cc	Sat Dec 25 19:10:50 2010 +0900
+++ b/Renderer/Engine/viewer.cc	Sat Dec 25 23:12:18 2010 +0900
@@ -12,6 +12,7 @@
 #include "Pad.h"
 #include "Application.h"
 #include "lindaapi.h"
+#include "SchedTask.h"
 
 /* measure for FPS (Frame Per Second) */
 static int start_time;
@@ -181,7 +182,7 @@
     }
 
     task_next = manager->create_task(RUN_LOOP_TASK,0,0,0,0);
-    task_next->set_param(0, (void*)viewer);
+    task_next->set_param(0, (void*)this);
    
     // ここは、Iterator を用意するべきだよね
     for (int j = 0; j < spe_num; j++) {
@@ -194,7 +195,7 @@
 
     task_next->spawn();
 
-    return task_next;
+    return 0;
 }
 
 
@@ -247,10 +248,7 @@
 void
 Viewer::mainLoop()
 {
-    HTaskPtr task_next = initLoop();
-
-
-    task_next->spawn();
+    initLoop();
 }
 
 void
@@ -302,7 +300,7 @@
 {
 
   Viewer *viewer = (Viewer*)smanager->get_param(0);
-  HTaskPtr task_next = smanager->create_task(RUN_DRAW_TASK, 0, 0, 0, 0);
+  HTaskPtr task_next = smanager->create_task(RENDERING_TASK, 0, 0, 0, 0);
   task_next->set_param(0, (void*)viewer);
 
   viewer->run_loop(task_next);
@@ -318,13 +316,6 @@
 {
 }
 
-void
-post2rendering(SchedTask *s, void *viewer_, void *arg)
-{
-    Viewer *viewer = (Viewer *)viewer_;
-    HTaskPtr task_next = viewer->manager->create_task(Dummy,0,0,0,0);
-    viewer->rendering(task_next);
-}
 
 void 
 Viewer::rendering(HTaskPtr task_next)
@@ -344,10 +335,10 @@
 rendering_task(SchedTask* smanager, void* rbuf, void* wbuf)
 {
 
-  Viewer* viewer = smanager->get_param(0);
-  HTaskPtr task_next = smanager->create_task(RUN_LOOP_TASK, 0, 0, 0, 0); 
+  Viewer* viewer = (Viewer*)smanager->get_param(0);
+  HTaskPtr task_next = smanager->create_task(RUN_DRAW_TASK, 0, 0, 0, 0); 
   task_next->set_param(0, (void*)viewer);
-  viewer->common_rendering(task_next);
+  viewer->run_draw(task_next);
 
   return 0;
 
@@ -372,10 +363,10 @@
 {
 
   Viewer* viewer = (Viewer*)smanager->get_param(0);
-  HTaskPtr task_next = smanger->create_task(RUN_LOOP_TASK, 0, 0, 0, 0); 
+  HTaskPtr task_next = smanager->create_task(RUN_LOOP_TASK, 0, 0, 0, 0); 
   task_next->set_param(0, (void*)viewer);
-  viewer->common_draw(task_next);
-  viewer->frames++;
+  viewer->run_loop(task_next);
+  frames++;
 
   return 0;