Mercurial > MadButterfly
annotate src/mbaf/mbapp.c @ 296:2e97e8082d83
* Fix the symbol definition code which does not assume the id is the same as the mbname.
* Add appleTV style list demo. We need to add animation latter. It is staic for now.
author | wycc |
---|---|
date | Sun, 01 Feb 2009 16:28:28 +0800 |
parents | 2ca0773cd48d |
children | 84ce2d4a8c3f |
rev | line source |
---|---|
294 | 1 #include <mb.h> |
2 #include <mbapp.h> | |
3 MBApp *MBApp_Init(char *module) | |
4 { | |
5 MBApp *app = (MBApp *) malloc(sizeof(MBApp)); | |
6 X_MB_runtime_t *rt; | |
7 | |
8 rt = X_MB_new(":0.0", 800, 600); | |
9 | |
10 app->rt = rt; | |
11 app->rdman = X_MB_rdman(rt); | |
296
2e97e8082d83
* Fix the symbol definition code which does not assume the id is the same as the mbname.
wycc
parents:
294
diff
changeset
|
12 app->kbevents = X_MB_kbevents(rt); |
294 | 13 app->rootsprite= sprite_load(module,app->rdman, app->rdman->root_coord); |
14 rdman_attach_backend(app->rdman, rt); | |
15 MB_SPRITE_GOTO_SCENE(app->rootsprite, 1); | |
16 return app; | |
17 } | |
18 | |
19 void MBApp_setData(MBApp *app,void *data) | |
20 { | |
21 app->private = (void *) data; | |
22 } | |
23 | |
24 mb_tman_t *MBApp_getTimer(MBApp *app) | |
25 { | |
26 return X_MB_tman(app->rt); | |
27 } | |
28 | |
29 void MBApp_loop(MBApp *en) | |
30 { | |
31 /* | |
32 * Start handle connections, includes one to X server. | |
33 * User start to interact with the application. | |
34 */ | |
35 X_MB_handle_connection(en->rt); | |
36 | |
37 /* | |
38 * Clean | |
39 */ | |
40 X_MB_free(en->rt); | |
41 free(en); | |
42 } |