Hi! What hardware you are using?
I have no experience with the image providers, so perhaps someone on the list has the answer to your question... Sorry! Richard > -----Ursprüngliche Nachricht----- > Von: Erick Galassi [mailto:[EMAIL PROTECTED] > Gesendet: Samstag, 15. Juli 2006 21:14 > An: Unger Richard > Betreff: RES: [directfb-dev] How to Create SubSurfaces > > Richard, > > I´ve tried to use DSCAPS_SYSTEMONLY but is returns a NOT > SUPPORTED when I try to Render images. Do you know if is > depends on the layer or a not supported system memory should > be a problem to the whole application ? > > Thank you very much, > > Best Regards, > Erick > > > -----Mensagem original----- > De: Unger Richard [mailto:[EMAIL PROTECTED] Enviada > em: sexta-feira, 14 de julho de 2006 09:33 > Para: Erick Galassi > Assunto: AW: [directfb-dev] How to Create SubSurfaces > > Hi! > > Well, I don't really know any details of your application... > > My tipp was referring to the fact that DirectFB supports > allocation of Surface Memory both in the VideoCard and in > System Memory. How much of each is available depends on your > hardware, of course. > > So if you were currently allocating stuff in VRAM, you could > switch to using system RAM (presumably, even on your embedded > device there is more system > ram) or even use some system and some videoram to use all the space. > > Try using: workareaDSC.caps = DSCAPS_DSFLIPPING | DSCAPS_SYSTEMONLY ; > or > workareaDSC.caps = DSCAPS_DSFLIPPING | > DSCAPS_VIDEOONLY ; > > Note that not all devices support using the videoram for > additional surface allocation. > > However, if you are already using System memory, and still > get the Out of Memory Error, there is not much you can do - > you have run out of RAM, bad luck. > > I agree with you - you must preload your images in order to > display them quickly. Obviously you cannot load more images > than will fit in your RAM. > Also, because image files are often quite compressed, the > images can actually take more space in RAM as surface bitmaps > than they did stored on disk. > > If, in the end, you have more images to load than will fit in > memory, you have two choices: > * Live with the fact that some images will load more slowly. > * Implement some kind of cache for the images - after all, > once you have displayed a image, you could maybe reuse its > surface to preload another image. > > Regards, > Richard > > > > -----Ursprüngliche Nachricht----- > > Von: Erick Galassi [mailto:[EMAIL PROTECTED] > > Gesendet: Freitag, 14. Juli 2006 14:13 > > An: Unger Richard > > Betreff: RES: [directfb-dev] How to Create SubSurfaces > > > > Richard, > > > > But the problem is that I´m working with an embedded > device, which > > has a limited amount of system memory. Is that the write way of > > writting surfaces ? Thank you for your reply. > > > > Regards, > > Erick > > > > -----Mensagem original----- > > De: Unger Richard [mailto:[EMAIL PROTECTED] Enviada > > em: sexta-feira, 14 de julho de 2006 09:09 > > Para: Erick Galassi > > Assunto: AW: [directfb-dev] How to Create SubSurfaces > > > > Hi! > > > > Try to request allocation of the surfaces in System memory, rather > > than video memory... > > > > Richard > > > > > -----Ursprüngliche Nachricht----- > > > Von: [EMAIL PROTECTED] > > > [mailto:[EMAIL PROTECTED] Im Auftrag von Erick > > > Galassi > > > Gesendet: Donnerstag, 13. Juli 2006 15:07 > > > An: [email protected] > > > Betreff: [directfb-dev] How to Create SubSurfaces > > > > > > 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-users mailing list [email protected] http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users
