My requirement is to create a small surface(region) and I want to display a small icon using that surface. So , I want to create a surface having height and width as 100 px * 100 px and for coordinates I don't know which params I have to initialize.
The below code is just for your ref.
DFBSurfaceDescription desc = { 0 };
desc.flags |= DSDESC_CAPS | DSDESC_PIXELFORMAT | DSDESC_WIDTH |DSDESC_HEIGHT;
desc.caps = DSCAPS_VIDEOONLY ; //DSCAPS_VIDEOONLY ; //DSCAPS_SHARED; DSCAPS_SYSTEMONLY;
desc.pixelformat = DSPF_ARGB ;
desc.width = pstBuffer->ui4InWidth;
desc.height = pstBuffer->ui4InHeight;
ret = gpstDfb->CreateSurface( gpstDfb, &desc, &source );
And the desc structure is defined as below :
typedef struct {
DFBSurfaceDescriptionFlags flags; /* field validation */
DFBSurfaceCapabilities caps; /* capabilities */
int width; /* pixel width */
int height; /* pixel height */
DFBSurfacePixelFormat pixelformat; /* pixel format */
struct {
void *data; /* data pointer of existing buffer */
int pitch; /* pitch of buffer */
} preallocated[2];
struct {
const DFBColor *entries;
unsigned int size;
} palette; /* initial palette */
unsigned long resource_id; /* universal resource id, either user specified for general
purpose surfaces or id of layer or window */
DFBSurfaceHintFlags hints; /* usage hints for optimized allocation, format selection etc. */
} DFBSurfaceDescription;