Mercurial > MadButterfly
changeset 337:55e0b22b919e
examples/dynamic/mbapp.[ch] are not more used.
- If they are still there, it causes examples/dynamic crash.
Since MBApp defined in examples/dynamic/mbapp.[ch] are different
from ones in include/mbapp.h.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sat, 07 Mar 2009 22:59:11 +0800 |
parents | 995eb2c1a1aa |
children | 6a1b36738d3d |
files | examples/dynamic/mbapp.c examples/dynamic/mbapp.h |
diffstat | 2 files changed, 0 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/dynamic/mbapp.c Sat Mar 07 14:25:20 2009 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -#include <mb.h> -#include <mbapp.h> -MBApp *MBApp_Init(char *module) -{ - MBApp *app = (MBApp *) malloc(sizeof(MBApp)); - X_MB_runtime_t *rt; - - rt = X_MB_new(":0.0", 800, 600); - - app->rt = rt; - app->rdman = X_MB_rdman(rt); - app->rootsprite= sprite_load(module,app->rdman, app->rdman->root_coord); - rdman_attach_backend(app->rdman, rt); - MB_SPRITE_GOTO_SCENE(app->rootsprite, 1); - return app; -} - -void MBApp_setData(MBApp *app,void *data) -{ - app->private = (void *) data; -} - -mb_tman_t *MBApp_getTimer(MBApp *app) -{ - return X_MB_tman(app->rt); -} - -void MBApp_loop(MBApp *en) -{ - /* - * Start handle connections, includes one to X server. - * User start to interact with the application. - */ - X_MB_handle_connection(en->rt); - - /* - * Clean - */ - X_MB_free(en->rt); - free(en); -}
--- a/examples/dynamic/mbapp.h Sat Mar 07 14:25:20 2009 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -#ifndef __APP_H -#define __APP_H -typedef struct _mbapp MBApp; -struct _mbapp { - void *rt; - redraw_man_t *rdman; - mb_sprite_t *rootsprite; - mb_obj_t *root; - void *private; -}; -MBApp *MBApp_Init(char *module); -void MBApp_setData(MBApp *app,void *data); -mb_tman_t *MBApp_getTimer(MBApp *app); -void MBApp_loop(MBApp *en); -#define MBAPP_DATA(app,type) ((type *) ((app)->private)) -#define MBAPP_RDMAN(app) (((MBApp *) app)->rdman) - -#include "mbbutton.h" -#endif