[t:/]$ 지식_

DirectFB 그림 뿌리기

2008/06/13

코드 보면 그냥 알 수 있음.

#include <config.h>  
#include <stdio.h>  
#include <directfb.h>  
static IDirectFB *dfb = NULL;  
static IDirectFBSurface *primary = NULL;  
static int screen_width  = 0;  
static int screen_height = 0;  
static IDirectFBSurface *logo = NULL;  
int main (int argc, char **argv)  
{  
    int i;       

    DFBSurfaceDescription dsc;  
    IDirectFBImageProvider *provider;  

    DirectFBInit (&argc, &argv);    
    DirectFBCreate (&dfb);    
    dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN);    

    dsc.flags = DSDESC_CAPS;    
//    dsc.caps  = DSCAPS_PRIMARY;        
    dsc.caps  = DSCAPS_PRIMARY | DSCAPS_FLIPPING;    
    dfb->CreateSurface( dfb, &dsc, &primary );         

    primary->GetSize (primary, &screen_width, &screen_height);  
    dfb->CreateImageProvider (dfb, "/temp1.jpg", &provider);  
    provider->GetSurfaceDescription(provider, &dsc);  

    dfb->CreateSurface( dfb, &dsc, &logo );  

    provider->RenderTo (provider, logo, NULL);  
    provider->Release (provider);  

    primary->FillRectangle (primary, 0, 0, screen_width, screen_height);    </P>  
    for (i = 0; i < 800; i++) {  
        primary->Blit (primary, logo, NULL, i, 0);  
        primary->Flip (primary, NULL, DSFLIP_WAITFORSYNC);       

    }  
    logo->Release (logo);  
    primary->Release (primary);    

    while(1);  
    dfb->Release (dfb);  
    return 23;  
}  








[t:/] is not "technology - root". dawnsea, rss