2 * dfb_api.c - api to dfb interface
12 #define MY_FONT_HEIGHT 48
17 static IDirectFB *dfb = NULL;
18 static IDirectFBSurface *primary = NULL;
19 static int screen_width = 0;
20 static int screen_height = 0;
22 static IDirectFBSurface *logo = NULL;
24 static IDirectFBFont *font = NULL;
25 static char *text_top="Internet Video / Audio Conferencing"
28 char dfb_image[]="./images/ivac_logo.png";
30 int main (int argc, char **argv) {
32 DFBFontDescription font_desc;
33 DFBSurfaceDescription dsc;
35 IDirectFBImageProvider *provider;
38 DirectFBInit (&argc, &argv);
39 DirectFBCreate (&dfb);
40 dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN);
41 dsc.flags=DSDESC_CAPS;
42 dsc.caps=DSCAPS_PRIMARY | DSCAPS_FLIPPING;
43 dfb->CreateSurface(dfb,&dsc,&primary);
44 primary->GetSize(primary,&screen_width,&screen_height);
45 printf("debug: w/h = %d / %d\n",screen_width,screen_height);
47 /* create the imag provider */
48 dfb->CreateImageProvider(dfb,dfb_image,&provider);
49 /* get image/provider description */
50 provider->GetSurfaceDescription(provider,&dsc);
51 printf("debug: w/h %d / %d\n",dsc.width,dsc.height);
52 /* create apropriate surface */
53 dfb->CreateSurface(dfb,&dsc,&logo);
55 provider->RenderTo(provider,logo,NULL);
56 provider->Release(provider);
59 font_dsc.flags=DFDESC_HEIGHT;
60 font_dsc.height=MY_FONT_HEIGHT;
65 for(i = -dsc.width; i < screen_width; i++) {
67 primary->FillRectangle(primary,0,0,screen_width,screen_height);
70 primary->Blit(primary,logo,NULL,i,(screen_height-dsc.height)/2);
73 primary->Flip(primary,NULL,DSFLIP_WAITFORSYNC);
79 primary->Release(primary);