> // assume that pixelformat of the surface is RGB32
> int pitch=0;
> int x = 10;//x position of the first point
> int y = 10;
> u32 *buf = 0;
> DFBResult ret;
> // get direct access to the surface memory
> ret =surface->Lock( surface, DSLF_WRITE, &buf, &pitch );
> if ( DFB_OK == ret ) {
> buf[ x + y*pitch/4 ] = 0xFF0000; // red pixel
> x++;
> buf[ x + y*pitch/4 ] = 0xFF00; // green pixel
> x++;
> buf[ x + y*pitch/4 ] = 0xFF; // blue pixel
> // and so on ...
> }
> surface->Unlock( surface );
Unlock() is called when ret != DFB_OK. Is that correct?
Phil.
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev