comparison TaskManager/Test/test_render/main.cpp @ 109:028ffc9c0375 draft

Cerium cvs version
author gongo@gendarme.local
date Wed, 12 Nov 2008 17:39:33 +0900
parents
children 594093237a15
comparison
equal deleted inserted replaced
108:6f3b3dd3c095 109:028ffc9c0375
1 #include "TaskManager.h"
2 #include "viewer.h"
3 #include "viewerSDL.h"
4 #include "viewerFB.h"
5 #include "Func.h"
6
7 /* prototype */
8 void init(int argc, char *argc[]);
9
10 extern void task_initialize();
11
12 Viewer *screen;
13
14 void
15 init(int argc, char *argv[])
16 {
17 int bpp = 0;
18 int width = 640;
19 int height = 480;
20 int spenum = 1;
21 char *xml = "xml_file/cube.xml";
22 video_type vtype = VTYPE_SDL;
23
24 for(int i = 1; argv[i]; ++i)
25 {
26 if (strcmp(argv[i], "-bpp") == 0) {
27 bpp = atoi(argv[++i]);
28 }
29 if (strcmp(argv[i], "-width") == 0) {
30 width = atoi(argv[++i]);
31 }
32 if (strcmp(argv[i], "-height") == 0) {
33 height = atoi(argv[++i]);
34 }
35 if (strcmp(argv[i], "-xml") == 0) {
36 xml = argv[++i];
37 }
38 if (strcmp(argv[i], "-cpu") == 0) {
39 spenum = atoi(argv[++i]);
40 }
41 if (strcmp(argv[i], "-video") == 0) {
42 if (strcmp(argv[i+1], "sdl") == 0) {
43 vtype = VTYPE_SDL;
44 } else if (strcmp(argv[i+1], "fb") == 0) {
45 vtype = VTYPE_FB;
46 }
47 i++;
48 }
49 }
50
51 if (vtype == VTYPE_SDL) {
52 screen = new ViewerSDL(bpp, width, height, spenum);
53 } else if (vtype == VTYPE_FB) {
54 screen = new ViewerFB(bpp, width, height, spenum);
55 }
56
57 screen->video_init();
58 screen->run_init(xml);
59 }
60
61 int
62 cerium_main(int argc, char *argv[])
63 {
64 task_initialize();
65
66 init(argc, argv);
67
68 return 0;
69 }