|
Roadmap |
Site sponsored by
IGEL
|
||
|
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [directfb-dev] Re: directfb on xscale
Sven Neumann <neo@convergence.de> wrote:
> Clemens Kirchgatterer <c.kirchgatterer@amatic.com> writes:
>
> > my next aproach was a basic DFB test programm, that loads 2 png
> > files
> > (each 256 colors without alpha, i hope) and tried to blit one as the
> > screen background and the other over that background. this is
> > awfully
> > slow. i can follow the blitt easily with naked eye. (1 fps, i think)
>
> Do you render directly from the image provider to the destination
> surface or do you use an offscreen surface the same pixel format than
> the destination? There are quite a few things you might be doing wrong
> (or rather ineffeciently), so you will have to give us some more
> details. Perhaps show us some code snippets?
the test programm is more or less a copy found in the tutorial.
additionally it prints the number of frames every second.
a 16bit per pixel image is twice as slow. (unsurprisingly)
thank you for having a look ...
clemens
#include <stdio.h>
#include <unistd.h>
#include <sys/time.h>
#include <directfb.h>
static void
fps(void) {
static struct timeval tv;
static int frames, sec;
gettimeofday(&tv, NULL);
if (tv.tv_sec != sec) {
printf("\rFPS: %02i", frames);
fflush(stdout);
sec = tv.tv_sec;
frames = 0;
}
frames++;
}
int main (int argc, char **argv) {
IDirectFBImageProvider *provider;
IDirectFBSurface *primary = NULL;
IDirectFBSurface *logo = NULL;
DFBSurfaceDescription dsc;
IDirectFB *dfb = NULL;
int screen_width = 0;
int screen_height = 0;
DirectFBInit (&argc, &argv);
DirectFBCreate (&dfb);
dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN);
dsc.flags = DSDESC_CAPS;
dsc.caps = DSCAPS_PRIMARY;
dfb->CreateSurface( dfb, &dsc, &primary );
primary->GetSize (primary, &screen_width, &screen_height);
dfb->CreateImageProvider (dfb, DATADIR"/bgnd256.png", &provider);
provider->GetSurfaceDescription (provider, &dsc);
dfb->CreateSurface( dfb, &dsc, &logo );
provider->RenderTo (provider, logo, NULL);
provider->Release (provider);
primary->Flip(primary, NULL, 0);
while (1) {
//usleep(10000);
primary->Blit(primary, logo, NULL, 0, 0);
fps();
}
logo->Release (logo);
primary->Release (primary);
dfb->Release (dfb);
return 0;
}
--
Info: To unsubscribe send a mail to ecartis@directfb.org with
"unsubscribe directfb-dev" as subject.
|
|
| directfb.org |
|
Development |
|
Old Archives |