I now see that the DFBSurfaceDescription flag DSDESC_PREALLOCATED must be set for the data pointer to be used to point to a pre-allocated buffer.
-----Original Message----- From: Chris Bore [mailto:[EMAIL PROTECTED] Sent: 14 June 2007 16:10 To: 'directfb-users@directfb.org' Subject: RE: [directfb-users] Valid use of Surface data pointer? Thanks. I was actually thinking of the pointer in DFBSurfaceDescription: *data; data pointer of existing buffer If I GetSurfaceDescription for a Provider then does this give me a pointer to their data buffer? That seemed a bit to bypass the methods. Lock() seems fine, although that also might be thought a backdoor way to get at internal data - at least it is explicit. I am also not sure (not having used it this way) what is the risk of providing an 'existing buffer' when creating a surface? (I presume the data pointer is null by default and is then ignored). (PS - sorry for these seemingly odd questions, I am working to clarify a lot of DirectFB things for some training and documentation) Chris ======================== Chris Bore BORES Signal Processing [EMAIL PROTECTED] www.bores.com Tel: +44 1483 740138 Mobile: +44 7921 153 219 -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ben Combee Sent: 14 June 2007 14:02 To: [EMAIL PROTECTED] Cc: directfb-users@directfb.org Subject: Re: [directfb-users] Valid use of Surface data pointer? On 6/14/07, Chris Bore <[EMAIL PROTECTED]> wrote: > Should it be recommended that a 'user' of DirectFB should never use > the Surface data pointer, but should instead access that data only > through the Surface interface methods? Are you talking about the priv pointer? Anything accessed through priv is subject to change, so using that pointer means your application will likely break when you update your version of DirectFB. If you're talking about the pointer you get when you do a Lock() operation -- that's part of the documented interface. As long as you Unlock the surface and stop use of the data pointer while it's unlocked, you should be OK, although depending on the hardware, using the surface methods may be a lot faster than reading or writing from the surface's memory. _______________________________________________ directfb-users mailing list directfb-users@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users _______________________________________________ directfb-users mailing list directfb-users@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users