comparison src/mbaf/mbapp.c @ 454:9b8dda201ccb

Make naming convention consistent with MadButterfly.
author Thinker K.F. Li <thinker@branda.to>
date Thu, 06 Aug 2009 09:38:51 +0800
parents 84ce2d4a8c3f
children 26c302b47de1
comparison
equal deleted inserted replaced
453:84ce2d4a8c3f 454:9b8dda201ccb
1 #include <mb.h> 1 #include <mb.h>
2 #include <mbapp.h> 2 #include <mbapp.h>
3 MBApp *MBApp_Init(const char *module, const char *module_dir) 3
4 mbaf_t *mbaf_init(const char *module, const char *module_dir)
4 { 5 {
5 MBApp *app = (MBApp *) malloc(sizeof(MBApp)); 6 mbaf_t *app = (mbaf_t *) malloc(sizeof(mbaf_t));
6 X_MB_runtime_t *rt; 7 X_MB_runtime_t *rt;
7 8
8 rt = X_MB_new(":0.0", 800, 600); 9 rt = X_MB_new(":0.0", 800, 600);
9 if(rt == NULL) 10 if(rt == NULL)
10 return NULL; 11 return NULL;
26 MB_SPRITE_GOTO_SCENE(app->rootsprite, 1); 27 MB_SPRITE_GOTO_SCENE(app->rootsprite, 1);
27 28
28 return app; 29 return app;
29 } 30 }
30 31
31 void MBApp_setData(MBApp *app,void *data) 32 void mbaf_set_data(mbaf_t *app,void *data)
32 { 33 {
33 app->private = (void *) data; 34 app->private = (void *) data;
34 } 35 }
35 36
36 mb_tman_t *MBApp_getTimer(MBApp *app) 37 mb_tman_t *mbaf_get_timer(mbaf_t *app)
37 { 38 {
38 return X_MB_tman(app->rt); 39 return X_MB_tman(app->rt);
39 } 40 }
40 41
41 void MBApp_loop(MBApp *en) 42 void mbaf_loop(mbaf_t *app)
42 { 43 {
43 /* 44 /*
44 * Start handle connections, includes one to X server. 45 * Start handle connections, includes one to X server.
45 * User start to interact with the application. 46 * User start to interact with the application.
46 */ 47 */
47 X_MB_handle_connection(en->rt); 48 X_MB_handle_connection(app->rt);
48 49
49 /* 50 /*
50 * Clean 51 * Clean
51 */ 52 */
52 X_MB_free(en->rt); 53 X_MB_free(app->rt);
53 free(en); 54 free(app);
54 } 55 }