Mercurial > hg > Members > e085722 > Cerium
comparison Renderer/Test/panel.cc @ 0:04e28d8d3c6f
first commit
author | Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 08 Nov 2010 01:23:25 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:04e28d8d3c6f |
---|---|
1 #include "SceneGraphRoot.h" | |
2 #include "panel.h" | |
3 | |
4 static void panel_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h); | |
5 static void panel_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h, | |
6 SceneGraphPtr tree); | |
7 | |
8 static void | |
9 panel_move(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h) | |
10 { | |
11 } | |
12 | |
13 static void | |
14 panel_collision(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h, | |
15 SceneGraphPtr tree) | |
16 { | |
17 } | |
18 | |
19 int bg = 0; | |
20 | |
21 MainLoopPtr | |
22 panel::init(Viewer *sgroot, int screen_w, int screen_h) | |
23 { | |
24 SceneGraphPtr panel; | |
25 | |
26 if (bg == 2) { | |
27 sgroot->createFromXMLfile( "xml_file/panel_512.xml"); | |
28 panel = sgroot->createSceneGraph("PANEL_512"); | |
29 } else if (bg == 3) { | |
30 sgroot->createFromXMLfile( "xml_file/panel_1024.xml"); | |
31 panel = sgroot->createSceneGraph("PANEL_1024"); | |
32 } else { | |
33 sgroot->createFromXMLfile( "xml_file/panel_2048.xml"); | |
34 panel = sgroot->createSceneGraph("PANEL_2048"); | |
35 } | |
36 | |
37 panel->set_move_collision(panel_move, panel_collision); | |
38 panel->xyz[2] = 30.0f; | |
39 sgroot->setSceneData(panel); | |
40 return sgroot; | |
41 } | |
42 | |
43 extern Application * | |
44 application() { | |
45 return new panel(); | |
46 } | |
47 | |
48 const char *usr_help_str = "Usage: ./test_nogl -sg [123] [OPTION]\n"; | |
49 | |
50 extern int init(TaskManager *manager, int argc, char *argv[]); | |
51 extern void task_initialize(); | |
52 static void TMend(TaskManager *manager); | |
53 | |
54 int | |
55 TMmain(TaskManager *manager, int argc, char *argv[]) | |
56 { | |
57 task_initialize(); | |
58 manager->set_TMend(TMend); | |
59 for(int i=0;i<argc;i++) { | |
60 if (strcmp(argv[i],"-sg")==0) { | |
61 bg = atoi(argv[i+1]); | |
62 } | |
63 } | |
64 return init(manager, argc, argv); | |
65 | |
66 } | |
67 | |
68 void | |
69 TMend(TaskManager *manager) | |
70 { | |
71 printf("test_nogl end\n"); | |
72 } | |
73 | |
74 /* end */ | |
75 |