Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/main.cc @ 603:42c94f85c779
long -> memaddr (64 or 32)
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 07 Nov 2009 14:13:29 +0900 |
parents | 0f180d46db89 |
children | 32a7260fad2f |
rev | line source |
---|---|
507 | 1 #include "TaskManager.h" |
2 #include "viewer.h" | |
3 #include "viewerSDL.h" | |
4 #include "viewerFB.h" | |
509
8148c81d2660
Cerium Rendering Library
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
507
diff
changeset
|
5 #include "Application.h" |
507 | 6 |
7 /* prototype */ | |
524 | 8 extern int init(TaskManager *manager, int argc, char *argv[]); |
507 | 9 static void TMend(TaskManager *manager); |
10 | |
11 extern void task_initialize(); | |
509
8148c81d2660
Cerium Rendering Library
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
507
diff
changeset
|
12 extern Application *application(); |
524 | 13 extern int init(TaskManager *manager, int argc, char *argv[]); |
507 | 14 |
524 | 15 // 大域変数は禁止 |
507 | 16 //static Viewer *screen; |
17 | |
524 | 18 /* |
507 | 19 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n\ |
20 -cpu Number of SPE (default 1)\n\ | |
21 -width, -height window size (default 640x480)\n\ | |
22 -sg Draw SceneGraph\n\ | |
23 0: Joystick の 丸ボタン(Keyboard だとx) を押すと、キューブが二つに分かれる\n\ | |
24 1: 0 のキューブが大きい版\n\ | |
25 2: テクスチャテスト:576x384\n\ | |
26 3: テクスチャテスト:1024x768\n\ | |
27 4: テクスチャテスト:2048x1536\n\ | |
28 5: 地球が動き、その周りを月が自転、公転する\n\ | |
29 6 以降: キューブが跳ね返りながら、勝手にキューブが増えて行く\n"; | |
524 | 30 */ |
507 | 31 |
32 int | |
33 init(TaskManager *manager, int argc, char *argv[]) | |
34 { | |
35 int bpp = 32; | |
36 int width = 640; | |
37 int height = 480; | |
38 int spenum = 1; | |
39 video_type vtype = VTYPE_SDL; | |
40 | |
41 for(int i = 1; argv[i]; ++i) | |
42 { | |
43 if (strcmp(argv[i], "-bpp") == 0) { | |
44 bpp = atoi(argv[++i]); | |
45 } | |
46 if (strcmp(argv[i], "-width") == 0) { | |
47 width = atoi(argv[++i]); | |
48 } | |
49 if (strcmp(argv[i], "-height") == 0) { | |
50 height = atoi(argv[++i]); | |
51 } | |
52 if (strcmp(argv[i], "-cpu") == 0) { | |
53 spenum = atoi(argv[++i]); | |
54 } | |
55 if (strcmp(argv[i], "-video") == 0) { | |
56 if (strcmp(argv[i+1], "sdl") == 0) { | |
57 vtype = VTYPE_SDL; | |
58 } else if (strcmp(argv[i+1], "fb") == 0) { | |
59 vtype = VTYPE_FB; | |
60 } | |
61 i++; | |
62 } | |
63 } | |
64 | |
65 Viewer *screen; | |
66 if (vtype == VTYPE_SDL) { | |
67 screen = new ViewerSDL(manager, bpp, width, height, spenum); | |
68 } else if (vtype == VTYPE_FB) { | |
69 screen = new ViewerFB(manager, bpp, width, height, spenum); | |
70 }else{ | |
71 screen = new ViewerSDL(manager, bpp, width, height, spenum); | |
72 } | |
73 | |
74 screen->video_init(manager); | |
509
8148c81d2660
Cerium Rendering Library
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
507
diff
changeset
|
75 screen->run_init(manager, application()); |
507 | 76 |
77 | |
78 return 0; | |
79 } | |
80 | |
524 | 81 #if 0 |
507 | 82 int |
83 TMmain(TaskManager *manager, int argc, char *argv[]) | |
84 { | |
85 task_initialize(); | |
524 | 86 manager->set_TMend(TMend); |
507 | 87 return init(manager, argc, argv); |
88 | |
89 } | |
90 | |
91 void | |
92 TMend(TaskManager *manager) | |
93 { | |
94 printf("test_nogl end\n"); | |
95 } | |
524 | 96 |
97 #endif |