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