Mercurial > hg > Members > kono > Cerium
view Renderer/Test/panel.cc @ 656:d0b8860c17f8
remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
author | hiroki@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Wed, 25 Nov 2009 21:56:14 +0900 |
parents | b21a013051a2 |
children | 4dc02d3e98bb |
line wrap: on
line source
#include "SceneGraphRoot.h" #include "panel.h" static void panel_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h); static void panel_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h, SceneGraphPtr tree); static void panel_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h) { } static void panel_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h, SceneGraphPtr tree) { } int bg = 0; MainLoopPtr panel::init(Viewer *sgroot, int screen_w, int screen_h) { SceneGraphPtr panel; if (bg == 2) { sgroot->createFromXMLfile( "xml_file/panel_512.xml"); panel = sgroot->createSceneGraph("PANEL_512"); } else if (bg == 3) { sgroot->createFromXMLfile( "xml_file/panel_1024.xml"); panel = sgroot->createSceneGraph("PANEL_1024"); } else { sgroot->createFromXMLfile( "xml_file/panel_2048.xml"); panel = sgroot->createSceneGraph("PANEL_2048"); } panel->set_move_collision(panel_move, panel_collision); panel->xyz[2] = 30.0f; sgroot->setSceneData(panel); return sgroot; } MainLoopPtr panel::init_only_sg(SgChange *sgroot, int screen_w, int screen_h) { 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")==0) { bg = atoi(argv[i+1]); } } return init(manager, argc, argv); } void TMend(TaskManager *manager) { printf("test_nogl end\n"); } /* end */