Mercurial > hg > Game > Cerium
comparison TaskManager/Test/test_render/main.cpp @ 397:ce86b0186a4a draft
delete manager (in kernel/ppe/TaskManager.h)
don't move.
author | game@henri.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Sun, 20 Sep 2009 18:55:26 +0900 |
parents | ef6b225f6f40 |
children |
comparison
equal
deleted
inserted
replaced
396:0b623693e6ec | 397:ce86b0186a4a |
---|---|
3 #include "viewerSDL.h" | 3 #include "viewerSDL.h" |
4 #include "viewerFB.h" | 4 #include "viewerFB.h" |
5 #include "Func.h" | 5 #include "Func.h" |
6 | 6 |
7 /* prototype */ | 7 /* prototype */ |
8 static int init(int argc, char *argv[]); | 8 static int init(TaskManager *manager, int argc, char *argv[]); |
9 static void TMend(void); | 9 static void TMend(TaskManager *manager); |
10 | 10 |
11 extern void task_initialize(); | 11 extern void task_initialize(); |
12 | 12 |
13 Viewer *screen; | 13 // 帯域変数は禁止 |
14 //static Viewer *screen; | |
15 static int sg_number = 0; | |
14 | 16 |
15 static int sg_number = 0; | |
16 | 17 |
17 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n\ | 18 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n\ |
18 -cpu Number of SPE (default 1)\n\ | 19 -cpu Number of SPE (default 1)\n\ |
19 -width, -height window size (default 640x480)\n\ | 20 -width, -height window size (default 640x480)\n\ |
20 -sg Draw SceneGraph\n\ | 21 -sg Draw SceneGraph\n\ |
25 4: テクスチャテスト:2048x1536\n\ | 26 4: テクスチャテスト:2048x1536\n\ |
26 5: 地球が動き、その周りを月が自転、公転する\n\ | 27 5: 地球が動き、その周りを月が自転、公転する\n\ |
27 6 以降: キューブが跳ね返りながら、勝手にキューブが増えて行く\n"; | 28 6 以降: キューブが跳ね返りながら、勝手にキューブが増えて行く\n"; |
28 | 29 |
29 int | 30 int |
30 init(int argc, char *argv[]) | 31 init(TaskManager *manager, int argc, char *argv[]) |
31 { | 32 { |
32 int bpp = 32; | 33 int bpp = 32; |
33 int width = 640; | 34 int width = 640; |
34 int height = 480; | 35 int height = 480; |
35 int spenum = 1; | 36 int spenum = 1; |
64 } | 65 } |
65 i++; | 66 i++; |
66 } | 67 } |
67 } | 68 } |
68 | 69 |
70 Viewer *screen; | |
69 if (vtype == VTYPE_SDL) { | 71 if (vtype == VTYPE_SDL) { |
70 screen = new ViewerSDL(bpp, width, height, spenum); | 72 screen = new ViewerSDL(manager, bpp, width, height, spenum); |
71 } else if (vtype == VTYPE_FB) { | 73 } else if (vtype == VTYPE_FB) { |
72 screen = new ViewerFB(bpp, width, height, spenum); | 74 screen = new ViewerFB(manager, bpp, width, height, spenum); |
75 }else{ | |
76 screen = new ViewerSDL(manager, bpp, width, height, spenum); | |
73 } | 77 } |
74 | 78 |
75 screen->video_init(); | 79 screen->video_init(manager); |
76 screen->run_init(xml, sg_number); | 80 screen->run_init(manager, xml, sg_number); |
77 | 81 |
78 manager->set_TMend(TMend); | 82 manager->set_TMend(TMend); |
79 | 83 |
80 return 0; | 84 return 0; |
81 } | 85 } |
82 | 86 |
83 int | 87 int |
84 TMmain(int argc, char *argv[]) | 88 TMmain(TaskManager *manager, int argc, char *argv[]) |
85 { | 89 { |
86 task_initialize(); | 90 task_initialize(); |
87 | 91 return init(manager, argc, argv); |
88 return init(argc, argv); | |
89 | 92 |
90 //return 0; | 93 //return 0; |
91 } | 94 } |
92 | 95 |
93 void | 96 void |
94 TMend(void) | 97 TMend(TaskManager *manager) |
95 { | 98 { |
96 printf("test_nogl end\n"); | 99 printf("test_nogl end\n"); |
97 } | 100 } |