DirectFB - Home of the pragmatist Roadmap


[directfb-dev] StretchBlit problem
Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[directfb-dev] StretchBlit problem



Hello.
I have the problem then run this program:
--------------------------------------------------------
static IDirectFB *dfb = NULL;
static IDirectFBSurface *primary = NULL;
static IDirectFBSurface *picture = NULL;
static int screen_width = 0;
static int screen_height = 0;

int main(int argc,char **argv)
{
    DFBSurfaceDescription dsc;
    IDirectFBImageProvider *provider;
    char *dirname="./data";
    const char *imagename="./data/dfblogo.png";
    DFBRectangle *dest;
    char *p_types[]={"*.jpg","*.jpeg","*.gif","*.png"};
    struct dirent **namelist;
    int n,t;
    
    DirectFBInit(&argc,&argv);
    DirectFBCreate(&dfb);
    dfb->SetCooperativeLevel(dfb,DFSCL_FULLSCREEN);
    dsc.flags = DSDESC_CAPS;
    dsc.caps = DSCAPS_PRIMARY|DSCAPS_FLIPPING;
    dfb->CreateSurface(dfb,&dsc,&primary);
    primary->GetSize(primary,&screen_width,&screen_height);
    dfb->CreateImageProvider(dfb,imagename,&provider);
    provider->GetSurfaceDescription(provider,&dsc);
    dfb->CreateSurface(dfb,&dsc,&picture);
    provider->RenderTo(provider,picture,NULL);
    provider->Release(provider);
    primary->FillRectangle(primary,0,0,screen_width,screen_height);
    dest->x=10;
    dest->y=10;
    dest->w=dsc.width/5;
    dest->h=dsc.height/5;
    primary->StretchBlit(primary,picture,NULL,dest);
    primary->Flip(primary,NULL,DSFLIP_WAITFORSYNC);
    sleep(5);
    picture->Release(picture);
    primary->Release(primary);
    dfb->Release(dfb);
    
    return 0;     
---------------------------------------------------------------------

It is run, dfblogo showed stretched but then program is finish - it is
not exit to shell - just hung on blue screen and don't react on any
buttons.
Then i run
    primary->Blit(primary,picture,NULL,0,(screen_height-dsc.height)/2);
all run good and program finish normal.

Any idea ?
    





http://www.genesis-cle266.tk



-- 
Info:  To unsubscribe send a mail to ecartis@directfb.org with 
"unsubscribe directfb-dev" as subject.



Home | Main Index | Thread Index


directfb.org / Development / Old Archives