X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fmorpheus.git;a=blobdiff_plain;f=display.c;fp=display.c;h=f61e7e23e95254abe827f3fb5a76d93f33527d8a;hp=0000000000000000000000000000000000000000;hb=0ba7850819572931f67d28ebca0cc7d73d7c6dea;hpb=3ec676caee02b75707e472b0294e8be51aab4c42 diff --git a/display.c b/display.c new file mode 100644 index 0000000..f61e7e2 --- /dev/null +++ b/display.c @@ -0,0 +1,55 @@ +/* + * display.c - visualization api + * + */ + +#include +#include + +#include "defines.h" + +#ifdef USE_DFB_API +static IDirectFB *dfb=NULL; +static IDirectFBSurface *primary_surface=NULL; +static int screen_width=0; +static int screen_height=0; +#endif + +int display_init(int x,int y,int z,display *display,u32 *cell,int *argc,char **argv) +{ +#ifdef USE_DFB_API + DFBSurfaceDescription surface_dsc; + // DFBFontDescription font_dsc; +#endif + + /* store dimensions */ + display->max_x=x; + display->max_y=y; + display->max_z=z; + /* store pointer to cells */ + display->cell_p=cell; + + /* the api(s) */ +#ifdef USE_DFB_API + DirectFBInit(argc,&argv); + DirectFBCreate(&dfb); + dfb->SetCooperativeLevel(dfb,DFSCL_FULLSCREEN); + surface_dsc.flags=DSDESC_CAPS; + surface_dsc.caps=DSCAPS_PRIMARY|DSCAPS_FLIPPING; + dfb->CreateSurface(dfb,&surface_dsc,&primary_surface); + primary_surface->GetSize(primary_surface,&screen_width,&screen_height); + display->dfb=dfb; + display->primary_surface=primary_surface; + display->screen_width=screen_width; + display->screen_height=screen_height; +#endif + return 23; +} + +int display_draw(u32 *cell,int x,int y,int z) +{ +#ifdef USE_DFB_API + +#endif + return 23; +}