Hi Claudio,

Thanks, I now see the method you describe in the df_fire example.

Thanks for the tip
Raymond



Claudio "KLaN" Ciccani wrote:

Raymond de Vries wrote:

Hello,

I have just discovered directfb a couple of days ago and I must say I
like it. Nice job you have done!

Now, being a newbie, I have searched the examples (also the latest
snapshot 20040713) and looked in the message archives but I could not
find what I am after. Plz bear with me when this is a faq...

I would like to create to surface from data that I generate myself. Is
there a simple way to load a surface with custom data? Or do I really
need to create another imageprovider? All I need to do is specify pixels
in the surface.

Thanks a lot for helping,
Raymond


btw I could pack my data into a png image and use a standard imageprovider but that would be a waste of computing resources

--

Raymond de Vries, VR Specialist
Insight Services
SARA Computing and Networking Services, PO Box 94613, 1090 GP AMSTERDAM
email: [EMAIL PROTECTED] Phone +31-20-592300 Fax +31-20-6683167









Look below.

IDirectFBSurface       *surface;
DFBSurfaceDescription   desc;

desc.flags = DSDESC_WIDTH | DSDESC_HEIGHT |
             DSDESC_PIXELFORMAT | DSDESC_PREALLOCATED;
desc.width = <width>
desc.height = <height>
desc.pixelformat = <format>
desc.preallocated.data = <pixels>
desc.preallocated.pitch = <bytes per line>

dfb->CreateSurface( dfb, &desc, &surface );


You can also Lock an existing surface and write to its buffer.



Regards,
Claudio





--

Raymond de Vries, VR Specialist
 Insight Services
 SARA Computing and Networking Services, PO Box 94613, 1090 GP  AMSTERDAM
 email: [EMAIL PROTECTED]   Phone +31-20-592300  Fax +31-20-6683167







Reply via email to