Hi All,
I´m facing a trouble while trying to create surfaces to show image files on
screen. My main issue is: if a create a surface for each image that is going to
be shown on the screen, after a certain amount of surfaces created I get a "out
of video memory" error. On the other hand, if I do not create and store surfaces
for each image the performance of my application will be very slow , considering
that I´ll need to RenderTo the imageprovider everytime that I want to print on
the screen.
So, I thought about using SubSurfaces, once that they may not use any extra
memory , but somehow I´m not being able to create and flip the subsurface
created. Following is part of my code:
{
primary surfaces is already created and named as : primary }
{ I
create a new surface , with the screen size , to be the main surface for images
subsurfaces, named as : workarea }
{
directfb is already initialize and named as : dfb }
{ I´m calling this new subsurface as imageSurface }
DFBSurfaceDescription workareaDSC;
workareaDSC.flags = DSDESC_CAPS | DSDESC_WIDTH |
DSDESC_HEIGHT;
workareaDSC.caps =
DSCAPS_DSFLIPPING;
workareaDSC.width =
screenWidth;
workareaDSC.height = screenHeight;
dfb->CreateSurface(dfb,&workareaDSC,&workarea);
DFBSurfaceDescription imageDSC;
imageDSC.flags = DSDESC_CAPS;
imageDSC.caps =
DSCAPS_SUBSURFACE;
DFBRectangle imageRECT;
{x , y , w and h are set with the image
(top,left,width,height) positions}
dfb->CreateImageProvider(dfb,imagepathname,&imageProvider);
imageProvider->GetSurfaceDescription(imageProvider,&imageDSC);
workarea->GetSubSurface(workarea,&imageRECT,&imageSurface);
imageProvider->RenderTo(imageProvider,imageSurface,NULL);
workarea->Blit(workarea,imageSurface,&imageRECT,imageLeft,imageTop);
workarea->Flip(workarea,NULL,DSFLIP_BLIT);
After running this code I get the following error:
RenderTo: Not Supported.
I´ve tried to render direct into the primary surface , however I still
get an error that says:
Blit-> Invalid area present
Please, excuse me if this is not the property way to ask such a question,
but It is my first time posting here. I also want more information about how to
colabotare with the DirectFB project, The API and Tutorial are very uptodate and
I really want help to improve the support over this technology.
Thank you all in
advance,
Erick
Galassi
_______________________________________________ directfb-dev mailing list [email protected] http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev
