Any way to draw ONE pixel is very slow. Therefore the function was not
included in the DirectFB.
You should get an access to gfx data of your surface and set pixels there.
See followed sample how to print a dump of the surface. To write into
surface you have to set DSLF_WRITE instead DSLF_READ in Lock() method.
h it's a height of the surface
---------------------------
int pitch;
int bytes_per_pixel = DFB_BYTES_PER_PIXEL( format_of_the_surface );
u8 *src;
surf->Lock( surf, DSLF_READ, &src, &pitch );//get access to inner buffer
int i,j;
for( i = y; i<y+h; i++ ){ //vert loop
u8 *pos= src + i * pitch;//to calc next line position I used the pitch
for( j=0; j < pitch; j += bytes_per_pixel ){//horz loop
switch( bytes_per_pixel ){
case 4:
printf( "%08X ", *((u32*)(pos+j)) );
break;
case 2:
printf( "%04X ", *((u16*)(pos+j)) );
break;
case 1:
printf( "%02X ", *((u8*)(pos+j)) );
break;
}
}
printf("\n");
}
surf->Unlock( surf );//release the buffer
2008/1/28, [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
> Dear all,
>
> I have no hardware acceleration on my platform(S3C2410 ARM9 200MHz),
> In my application, I have to draw pixels individualy. The overhead of
> "FillRectangle(surface,x1,y1,1,1)" is to high.
> Is there any efficient way to dot a pixel?
>
> Any comments are wellcome!
>
> Regars.
>
> JC-Chinag
>
>
> _______________________________________________
> directfb-users mailing list
> [email protected]
> http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users
>
--
Best Regards
Nikita Egorov
[EMAIL PROTECTED]
[EMAIL PROTECTED]
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users