changeset 557:ec72b601b71f

fix examlples (on going)
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 22 Oct 2009 17:34:12 +0900
parents 0f180d46db89
children b05bae017029
files Renderer/Test/Chain.h Renderer/Test/ball_bound.cc Renderer/Test/boss1_action.cc Renderer/Test/boss1_action.h Renderer/Test/chain.cc Renderer/Test/chain_old.cc Renderer/Test/direction.cc Renderer/Test/direction.h Renderer/Test/gaplant.cc Renderer/Test/gaplant.h Renderer/Test/ieshoot.cc Renderer/Test/ieshoot.h Renderer/Test/init_position.cc Renderer/Test/init_position.h Renderer/Test/long_cube.cc Renderer/Test/long_cube.h Renderer/Test/node.cc Renderer/Test/node.h Renderer/Test/panel.cc Renderer/Test/panel.h Renderer/Test/universe.cc Renderer/Test/universe.h Renderer/Test/untitled.cc Renderer/Test/untitled.h Renderer/Test/vacuum.cc Renderer/Test/vacuum.h
diffstat 26 files changed, 500 insertions(+), 75 deletions(-) [+]
line wrap: on
line diff
--- a/Renderer/Test/Chain.h	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/Chain.h	Thu Oct 22 17:34:12 2009 +0900
@@ -22,4 +22,7 @@
     void chain_move(TaskManager *manager, SceneGraphPtr sg, int w, int h);
     void chain_collision(SceneGraphPtr sg, int w, int h, SceneGraphPtr osg);
 
+    MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
+
+
 };
--- a/Renderer/Test/ball_bound.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/ball_bound.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -105,15 +105,8 @@
     }
 }
 
-extern Application *
-application() {
-    return new ball_bound();
-}
-
-const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
-
 MainLoopPtr 
-ball_bound::init(Viewer *viewer, int screen_w, int screen_h)
+ball_bound::init(Viewer *sgroot, int screen_w, int screen_h)
 {
     SceneGraphPtr ball;
 
@@ -121,9 +114,9 @@
     // random な値が欲しいなら、man random に方法が書いてあります。
     srandom(100);
 
-    viewer->createFromXMLfile("xml_file/Ball.xml");
+    sgroot->createFromXMLfile("xml_file/Ball.xml");
 
-    ball = viewer->createSceneGraph(Ball);
+    ball = sgroot->createSceneGraph(Ball);
     ball->set_move_collision(ball_move, ball_collision);
 
     h0 = screen_h/2;
@@ -134,11 +127,18 @@
     ball->xyz[1] = h0;
     ball->xyz[2] = 30.0f;
 
-    viewer->setSceneData(ball);
+    sgroot->setSceneData(ball);
+
+    return sgroot;
+}
 
-    return viewer;
+extern Application *
+application() {
+    return new ball_bound();
 }
 
+const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
+
 extern int init(TaskManager *manager, int argc, char *argv[]);
 extern void task_initialize();
 static void TMend(TaskManager *manager);
--- a/Renderer/Test/boss1_action.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/boss1_action.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -1,4 +1,5 @@
-#include "SGList.h"
+#include "SceneGraphRoot.h"
+#include "MainLoop.h"
 #include "boss1_action.h"
 
 /*
@@ -202,6 +203,14 @@
   }
 }
 
+extern Application *
+application() {
+    return new ball_bound();
+}
+
+const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
+
+
 static void
 blast_move(SceneGraphPtr node, int screen_w, int screen_h)
 {
@@ -223,14 +232,9 @@
   node->frame += 1;
 }
   
-void
-boss1_init(TaskManager *manager, int screen_w, int screen_h)
+MainLoopPtr
+bass1_action::boss1_init(Viewer *sgroot, int screen_w, int screen_h)
 {
-  SceneGraphPtr root;
-  SceneGraphPtr player;
-  SceneGraphPtr boss1;
-  SceneGraphPtr left_parts;
-  SceneGraphPtr right_parts;
 
   sgroot->createFromXMLfile(manager, "xml_file/boss1.xml");
   sgroot->createFromXMLfile(manager, "xml_file/player1.xml");
@@ -238,16 +242,16 @@
   sgroot->createFromXMLfile(manager, "xml_file/blast.xml");
   
   //rootとなるSceneGraphを生成
-  root = sgroot->createSceneGraph();
+  SceneGraphPtr root = sgroot->createSceneGraph();
   
   //自機の初期化
-  player = sgroot->createSceneGraph(PLAYER);
+  SceneGraphPtr player = sgroot->createSceneGraph(PLAYER);
   player->xyz[0] = screen_w/2;
   player->xyz[1] = screen_h - player_radius;
   root->addChild(player);
 
   //ボスの初期化
-  boss1 = sgroot->createSceneGraph(BOSS1);
+  SceneGraphPtr boss1 = sgroot->createSceneGraph(BOSS1);
   boss1->xyz[0] = screen_w/2;
   boss1->xyz[1] = boss_radius_y;
   //  boss1->xyz[2] = first_boss1_depth;
@@ -255,9 +259,9 @@
   root->addChild(boss1);
 
   //ボスの左右パーツを追加
-  left_parts = sgroot->createSceneGraph(BOSS1_L);
+  SceneGraphPtr left_parts = sgroot->createSceneGraph(BOSS1_L);
   boss1->addChild(left_parts);
-  right_parts = sgroot->createSceneGraph(BOSS1_R);
+  SceneGraphPtr right_parts = sgroot->createSceneGraph(BOSS1_R);
   boss1->addChild(right_parts);
 
   //各機体の動きと当たり判定をセット
@@ -266,4 +270,26 @@
   
   //仕上げ
   sgroot->setSceneData(root);
+    return sgroot;
 }
+
+extern int init(TaskManager *manager, int argc, char *argv[]);
+extern void task_initialize();
+static void TMend(TaskManager *manager);
+
+int
+TMmain(TaskManager *manager, int argc, char *argv[])
+{
+    task_initialize();
+    manager->set_TMend(TMend);
+    return init(manager, argc, argv);
+
+}
+
+void
+TMend(TaskManager *manager)
+{
+    printf("test_nogl end\n");
+}
+
+
--- a/Renderer/Test/boss1_action.h	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/boss1_action.h	Thu Oct 22 17:34:12 2009 +0900
@@ -3,7 +3,15 @@
 
 #include <math.h>
 #include "SceneGraphRoot.h"
-#include "SGList.h"
+#include "Application.h"
+#include "MainLoop.h"
+
+
+class boss1_action : public Application {
+
+    MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
+
+};
 
 static const float player_speed = 10.0f;
 static const float player_radius = 42.0f;
--- a/Renderer/Test/chain.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/chain.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -106,7 +106,7 @@
 }
 
 void
-Chain::init(TaskManager *manager, int w, int h)
+Chain::init(Viewer *sgroot, int w, int h)
 {
     SceneGraphPtr root_chain, chain;
     ChainPropertyPtr rcv;
@@ -159,5 +159,33 @@
     chain_init->spawn();
 
     sgroot->setSceneData(root_chain);
+    return sgroot;
+}
+
+extern Application *
+application() {
+    return new Chain();
 }
 
+const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
+
+extern int init(TaskManager *manager, int argc, char *argv[]);
+extern void task_initialize();
+static void TMend(TaskManager *manager);
+
+int
+TMmain(TaskManager *manager, int argc, char *argv[])
+{
+    task_initialize();
+    manager->set_TMend(TMend);
+    return init(manager, argc, argv);
+
+}
+
+void
+TMend(TaskManager *manager)
+{
+    printf("test_nogl end\n");
+}
+
+
--- a/Renderer/Test/chain_old.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/chain_old.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -126,8 +126,8 @@
 
 }
 
-void
-chain_old_init(TaskManager *manager, int w, int h)
+MainLoopPtr
+chain_old::init(Viewer *sgroot, int w, int h)
 {
     SceneGraphPtr root_old_chain, chain;
     CHAIN_VARS rcv;
@@ -156,4 +156,34 @@
     cv[0].can_move = FALSE;
 
     sgroot->setSceneData(root_old_chain);
+    return sgroot;
 }
+
+extern Application *
+application() {
+    return new ball_bound();
+}
+
+const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
+
+extern int init(TaskManager *manager, int argc, char *argv[]);
+extern void task_initialize();
+static void TMend(TaskManager *manager);
+
+int
+TMmain(TaskManager *manager, int argc, char *argv[])
+{
+    task_initialize();
+    manager->set_TMend(TMend);
+    return init(manager, argc, argv);
+
+}
+
+void
+TMend(TaskManager *manager)
+{
+    printf("test_nogl end\n");
+}
+
+/* end */
+
--- a/Renderer/Test/direction.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/direction.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -61,8 +61,8 @@
 {
 }
 
-void
-direction_init(TaskManager *manager)
+MainLoopPtr 
+direction::init(Viewer *sgroot, int screen_w, int screen_h)
 {
     SceneGraphPtr dx;
     SceneGraphPtr dy;
@@ -90,4 +90,32 @@
     back->angle[1] = -30.0f;
 
     sgroot->setSceneData(back);
+    return sgroot;
 }
+
+extern Application *
+application() {
+    return new direction();
+}
+
+const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
+
+extern int init(TaskManager *manager, int argc, char *argv[]);
+extern void task_initialize();
+static void TMend(TaskManager *manager);
+
+int
+TMmain(TaskManager *manager, int argc, char *argv[])
+{
+    task_initialize();
+    manager->set_TMend(TMend);
+    return init(manager, argc, argv);
+
+}
+
+void
+TMend(TaskManager *manager)
+{
+    printf("test_nogl end\n");
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Renderer/Test/direction.h	Thu Oct 22 17:34:12 2009 +0900
@@ -0,0 +1,11 @@
+#include <stdlib.h>
+#include "SceneGraphRoot.h"
+#include "Application.h"
+#include "MainLoop.h"
+
+class direction : public Application {
+
+    MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
+
+};
+
--- a/Renderer/Test/gaplant.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/gaplant.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -3,8 +3,8 @@
 #include "gaplant_action.h"
 #include "back_action.h"
 
-void
-init_gaplant(TaskManager *manager, int w, int h)
+MainLoopPtr
+gaplant::init_gaplant(Viewer *sgroot, int w, int h)
 {
     SceneGraphPtr back;
     SceneGraphPtr gaplant;
@@ -27,4 +27,5 @@
 
     back->addChild(gaplant);
     sgroot->setSceneData(back);        
+    return sgroot;
 }
--- a/Renderer/Test/gaplant.h	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/gaplant.h	Thu Oct 22 17:34:12 2009 +0900
@@ -1,2 +1,15 @@
 const double CHECK_HIT_RAD = 110;
 const double BALL_RAD = 100;
+
+#include <math.h>
+#include <stdlib.h>
+#include "SceneGraphRoot.h"
+#include "Application.h"
+#include "MainLoop.h"
+
+class gaplant : public Application {
+
+    MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
+
+};
+
--- a/Renderer/Test/ieshoot.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/ieshoot.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -188,8 +188,8 @@
 }
 
 
-void
-ieshoot_init(TaskManager *manager)
+MainLoopPtr
+ieshoot::init(Viewer *sgroot, int w, int h)
 {
     SceneGraphPtr iejiki;
     SceneGraphPtr enemy;
@@ -213,4 +213,32 @@
     back->addChild(enemy);
 
     sgroot->setSceneData(back);
+    return sgroot;
 }
+
+extern Application *
+application() {
+    return new ieshoot();
+}
+
+const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
+
+extern int init(TaskManager *manager, int argc, char *argv[]);
+extern void task_initialize();
+static void TMend(TaskManager *manager);
+
+int
+TMmain(TaskManager *manager, int argc, char *argv[])
+{
+    task_initialize();
+    manager->set_TMend(TMend);
+    return init(manager, argc, argv);
+
+}
+
+void
+TMend(TaskManager *manager)
+{
+    printf("test_nogl end\n");
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Renderer/Test/ieshoot.h	Thu Oct 22 17:34:12 2009 +0900
@@ -0,0 +1,12 @@
+#include <math.h>
+#include <stdlib.h>
+#include "SceneGraphRoot.h"
+#include "Application.h"
+#include "MainLoop.h"
+
+class ieshoot : public Application {
+
+    MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
+
+};
+
--- a/Renderer/Test/init_position.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/init_position.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -1,11 +1,11 @@
 #include "SceneGraphRoot.h"
-#include "SGList.h"
 #include "player_action.h"
 #include "enemy_action.h"
 #include "camera_action.h"
+#include "init_position.h"
 
-void
-init_position(TaskManager *manager, int w, int h)
+MainLoopPtr
+posiotion::init(Viewer *sgroot, int w, int h)
 {
     SceneGraphPtr back;
     SceneGraphPtr player;
@@ -33,4 +33,5 @@
     }
 
     sgroot->setSceneData(back);
+    return sgroot;
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Renderer/Test/init_position.h	Thu Oct 22 17:34:12 2009 +0900
@@ -0,0 +1,12 @@
+#include <math.h>
+#include <stdlib.h>
+#include "SceneGraphRoot.h"
+#include "Application.h"
+#include "MainLoop.h"
+
+class position : public Application {
+
+    MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
+
+};
+
--- a/Renderer/Test/long_cube.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/long_cube.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -1,5 +1,5 @@
 #include "SceneGraphRoot.h"
-#include "SGList.h"
+#include "long_cube.h"
 
 // prototype
 static void lcube_move(SceneGraphPtr node, int screen_w, int screen_h);
@@ -18,8 +18,8 @@
 }
 
 
-void
-lcube_init(TaskManager *manager, int screen_w, int screen_h)
+MainLoopPtr
+lcube_init(Viewer *sgroot, int screen_w, int screen_h)
 {
     SceneGraphPtr lcube;
 
@@ -28,4 +28,5 @@
     lcube->set_move_collision(lcube_move, lcube_collision);
 
     sgroot->setSceneData(lcube);
+    return sgroot;
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Renderer/Test/long_cube.h	Thu Oct 22 17:34:12 2009 +0900
@@ -0,0 +1,12 @@
+#include <math.h>
+#include <stdlib.h>
+#include "SceneGraphRoot.h"
+#include "Application.h"
+#include "MainLoop.h"
+
+class long_cube : public Application {
+
+    MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
+
+};
+
--- a/Renderer/Test/node.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/node.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -62,11 +62,41 @@
     }
 }
 
-void
-node_init(TaskManager *manager)
+MainLoopPtr
+node::init(Viewer *sgroot, int screen_w, int screen_h)
 {
     sgroot->createFromXMLfile(manager, "xml_file/cube.xml");
     Cube->set_move_collision(cube_move, cube_collision);
     Cube->stack_xyz[0] = 2.0f;
     Cube->stack_xyz[1] = 2.0f;
+    return sgroot;
 }
+
+extern Application *
+application() {
+    return new ball_bound();
+}
+
+const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
+
+extern int init(TaskManager *manager, int argc, char *argv[]);
+extern void task_initialize();
+static void TMend(TaskManager *manager);
+
+int
+TMmain(TaskManager *manager, int argc, char *argv[])
+{
+    task_initialize();
+    manager->set_TMend(TMend);
+    return init(manager, argc, argv);
+
+}
+
+void
+TMend(TaskManager *manager)
+{
+    printf("test_nogl end\n");
+}
+
+/* end */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Renderer/Test/node.h	Thu Oct 22 17:34:12 2009 +0900
@@ -0,0 +1,11 @@
+#include <stdlib.h>
+#include "SceneGraphRoot.h"
+#include "Application.h"
+#include "MainLoop.h"
+
+class node : public Application {
+
+    MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
+
+};
+
--- a/Renderer/Test/panel.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/panel.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -1,5 +1,5 @@
 #include "SceneGraphRoot.h"
-#include "SGList.h"
+#include "panel.h"
 
 static void panel_move(SceneGraphPtr node, int screen_w, int screen_h);
 static void panel_collision(SceneGraphPtr node, int screen_w, int screen_h,
@@ -16,8 +16,10 @@
 {
 }
 
-void
-panel_init(TaskManager *manager, int bg)
+int bg = 0;
+
+MainLoopPtr
+panel::init(Viewer *sgroot, int screen_w, int screen_h)
 {
     SceneGraphPtr panel;
 
@@ -35,4 +37,39 @@
     panel->set_move_collision(panel_move, panel_collision);
     panel->xyz[2] = 30.0f;
     sgroot->setSceneData(panel);
+    return sgroot;
 }
+
+extern Application *
+application() {
+    return new panel();
+}
+
+const char *usr_help_str = "Usage: ./test_nogl -sg [123] [OPTION]\n";
+
+extern int init(TaskManager *manager, int argc, char *argv[]);
+extern void task_initialize();
+static void TMend(TaskManager *manager);
+
+int
+TMmain(TaskManager *manager, int argc, char *argv[])
+{
+    task_initialize();
+    manager->set_TMend(TMend);
+    for(int i=0;i<argc;i++) {
+         if (strcmp(argv[i],"-sg")) {
+             bg = atoi(argv[i+1]);
+         }
+    }
+    return init(manager, argc, argv);
+
+}
+
+void
+TMend(TaskManager *manager)
+{
+    printf("test_nogl end\n");
+}
+
+/* end */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Renderer/Test/panel.h	Thu Oct 22 17:34:12 2009 +0900
@@ -0,0 +1,11 @@
+#include <stdlib.h>
+#include "SceneGraphRoot.h"
+#include "Application.h"
+#include "MainLoop.h"
+
+class ball_bound : public Application {
+
+    MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
+
+};
+
--- a/Renderer/Test/universe.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/universe.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -1,6 +1,6 @@
 #include <stdlib.h>
 #include "SceneGraphRoot.h"
-#include "SGList.h"
+#include "universe.h"
 
 static void
 earth_collision(SceneGraphPtr node, int screen_w, int screen_h,
@@ -40,8 +40,8 @@
     }
 }
 
-void
-universe_init(TaskManager *manager)
+MainLoopPtr
+universe::init(Viewer *sgroot, int screen_w, int screen_h)
 {
     SceneGraphPtr earth;
     SceneGraphPtr moon;
@@ -65,4 +65,35 @@
     // SceneGraphRoot に、使用する SceneGraph を設定する
     // このとき、ユーザーが記述した SceneGraph の root を渡す。
     sgroot->setSceneData(earth);
+    return sgroot;
 }
+
+
+extern Application *
+application() {
+    return new ball_bound();
+}
+
+const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
+
+extern int init(TaskManager *manager, int argc, char *argv[]);
+extern void task_initialize();
+static void TMend(TaskManager *manager);
+
+int
+TMmain(TaskManager *manager, int argc, char *argv[])
+{
+    task_initialize();
+    manager->set_TMend(TMend);
+    return init(manager, argc, argv);
+
+}
+
+void
+TMend(TaskManager *manager)
+{
+    printf("test_nogl end\n");
+}
+
+/* end */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Renderer/Test/universe.h	Thu Oct 22 17:34:12 2009 +0900
@@ -0,0 +1,12 @@
+#include <math.h>
+#include <stdlib.h>
+#include "SceneGraphRoot.h"
+#include "Application.h"
+#include "MainLoop.h"
+
+class universe : public Application {
+
+    MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
+
+};
+
--- a/Renderer/Test/untitled.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/untitled.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -73,8 +73,8 @@
   
 }
 
-void
-untitled_init(TaskManager *manager)
+MainLoopPtr
+untitled::init(Viewer *sgroot, int screen_w, int screen_h)
 {
     SceneGraphPtr test00;
     SceneGraphPtr test01;
@@ -145,5 +145,34 @@
     // SceneGraphRoot に、使用する SceneGraph を設定する
     // このとき、ユーザーが記述した SceneGraph の root を渡す。
     sgroot->setSceneData(test00);
-    
+    return sgroot;    
+}
+
+extern Application *
+application() {
+    return new untitiled();
 }
+
+const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
+
+extern int init(TaskManager *manager, int argc, char *argv[]);
+extern void task_initialize();
+static void TMend(TaskManager *manager);
+
+int
+TMmain(TaskManager *manager, int argc, char *argv[])
+{
+    task_initialize();
+    manager->set_TMend(TMend);
+    return init(manager, argc, argv);
+
+}
+
+void
+TMend(TaskManager *manager)
+{
+    printf("test_nogl end\n");
+}
+
+/* end */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Renderer/Test/untitled.h	Thu Oct 22 17:34:12 2009 +0900
@@ -0,0 +1,12 @@
+#include <math.h>
+#include <stdlib.h>
+#include "SceneGraphRoot.h"
+#include "Application.h"
+#include "MainLoop.h"
+
+class untitiled : public Application {
+
+    MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
+
+};
+
--- a/Renderer/Test/vacuum.cc	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/vacuum.cc	Thu Oct 22 17:34:12 2009 +0900
@@ -156,8 +156,8 @@
 }
 
 
-void
-vacuum_init2(TaskManager *manager, int w, int h)
+MainLoopPtr
+vacuum::init(Viewer *sgroot, int w, int h)
 {
     SceneGraphPtr title;
 
@@ -171,4 +171,32 @@
     title->set_move_collision(no_move_idle, title_collision);
 
     sgroot->setSceneData(title);
+    return sgroot;
 }
+
+extern Application *
+application() {
+    return new vacuum();
+}
+
+const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
+
+extern int init(TaskManager *manager, int argc, char *argv[]);
+extern void task_initialize();
+static void TMend(TaskManager *manager);
+
+int
+TMmain(TaskManager *manager, int argc, char *argv[])
+{
+    task_initialize();
+    manager->set_TMend(TMend);
+    return init(manager, argc, argv);
+
+}
+
+void
+TMend(TaskManager *manager)
+{
+    printf("test_nogl end\n");
+}
+
--- a/Renderer/Test/vacuum.h	Thu Oct 22 14:05:24 2009 +0900
+++ b/Renderer/Test/vacuum.h	Thu Oct 22 17:34:12 2009 +0900
@@ -1,28 +1,38 @@
 #ifndef VACUUM_H
 #define VACUUM_H
 
-#include "SGList.h"
+#include <math.h>
+#include <stdlib.h>
 #include "SceneGraphRoot.h"
+#include "Application.h"
+#include "MainLoop.h"
+
+class vacuum : public Application {
+
+    MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
+
+};
+
 
-void cube_move_left(SceneGraphPtr node, int screen_w, int screen_h);
-void cube_move_right(SceneGraphPtr node, int screen_w, int screen_h);
-void no_move_idle(SceneGraphPtr node, int screen_w, int screen_h);
-void cube_collision_idle(SceneGraphPtr node, int screen_w, int screen_h,SceneGraphPtr tree);
-void cube_collision(SceneGraphPtr node, int screen_w, int screen_h,SceneGraphPtr tree);
-void cube_split(SceneGraphPtr root,SceneGraphPtr tree);
-void vacuum_move(SceneGraphPtr node, int w, int h);
-void vacuum_coll(SceneGraphPtr node, int w, int h,SceneGraphPtr tree);
-void title_idle(SceneGraphPtr node, int screen_w, int screen_h);
-void title_collision(SceneGraphPtr node, int screen_w, int screen_h,SceneGraphPtr tree);
-void scene_change(int w,int h,SceneGraphPtr node);
-void gameover_idle(SceneGraphPtr node, int screen_w, int screen_h);
-void gameover_collision(SceneGraphPtr node, int screen_w, int screen_h,SceneGraphPtr tree);
-void collision_red(SceneGraphIteratorPtr it,SceneGraphPtr node);
-void collision_purple(SceneGraphIteratorPtr it,SceneGraphPtr node,int w,int h);
-void gameover_scene(int w,int h, SceneGraphPtr node);
-void add_cubecollision_object(int id,SceneGraphPtr root,int w,int h);
-void lock_attack(SceneGraphPtr node,SceneGraphIteratorPtr it);
-void lockon_collision(SceneGraphPtr node,int w,int h,SceneGraphPtr tree);
-void cube_rotate(SceneGraphPtr node,int w,int h);
+static void cube_move_left(SceneGraphPtr node, int screen_w, int screen_h);
+static void cube_move_right(SceneGraphPtr node, int screen_w, int screen_h);
+static void no_move_idle(SceneGraphPtr node, int screen_w, int screen_h);
+static void cube_collision_idle(SceneGraphPtr node, int screen_w, int screen_h,SceneGraphPtr tree);
+static void cube_collision(SceneGraphPtr node, int screen_w, int screen_h,SceneGraphPtr tree);
+static void cube_split(SceneGraphPtr root,SceneGraphPtr tree);
+static void vacuum_move(SceneGraphPtr node, int w, int h);
+static void vacuum_coll(SceneGraphPtr node, int w, int h,SceneGraphPtr tree);
+static void title_idle(SceneGraphPtr node, int screen_w, int screen_h);
+static void title_collision(SceneGraphPtr node, int screen_w, int screen_h,SceneGraphPtr tree);
+static void scene_change(int w,int h,SceneGraphPtr node);
+static void gameover_idle(SceneGraphPtr node, int screen_w, int screen_h);
+static void gameover_collision(SceneGraphPtr node, int screen_w, int screen_h,SceneGraphPtr tree);
+static void collision_red(SceneGraphIteratorPtr it,SceneGraphPtr node);
+static void collision_purple(SceneGraphIteratorPtr it,SceneGraphPtr node,int w,int h);
+static void gameover_scene(int w,int h, SceneGraphPtr node);
+static void add_cubecollision_object(int id,SceneGraphPtr root,int w,int h);
+static void lock_attack(SceneGraphPtr node,SceneGraphIteratorPtr it);
+static void lockon_collision(SceneGraphPtr node,int w,int h,SceneGraphPtr tree);
+static void cube_rotate(SceneGraphPtr node,int w,int h);
 
 #endif