Hi there,

I'm new to directfb and have a question on how to draw a mouse cursor. I'm 
wondering if someone can help me with this.
Here is what I have done so far:

DirectFBCreate
dsc.flags = DSDESC_CAPS;
dsc.caps = DSCAPS_PRIMARY;
dfb->CreateSurface(&dfb, &dsc, &primary);
primary->GetSize(&primary, &width, &height);
dfb->SetVideoMode(&dfb, width, height, dstBpp);
dfb->CreateInputEventBuffer(&dfb, DICAPS_ALL, DFB_TRUE, &event_buffer);

dfb->GetDisplayLayer(&dfb, 0, &layer);
layer->EnableCursor(&layer, 1);

dsc.flags = DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT;
dsc.caps = DSCAPS_SYSTEMONLY;
dsc.width =width;
dsc.height = height;
dsc.pixelformat = (server_depth == 32) ? DSPF_RGB32 : DSPF_RGB16;
dfb->CreateSurface(&dfb, &dsc, &surface);
surface->Lock(&surface, DSLF_WRITE, (void **) &buf, &i);

mouseSurfaceDesc.flags = DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT | 
DSDESC_PIXELFORMAT;
mouseSurfaceDesc.caps = DSCAPS_SYSTEMONLY;
mouseSurfaceDesc.width = 32
mouseSurfaceDesc.height = 32;
mouseSurfaceDesc.pixelformat = (server_depth == 32) ? DSPF_RGB32 :
DSPF_RGB16;

err = dfb->CreateSurface(&dfb, &mouseSurfaceDesc, &mouseSurface);

Here is where I get a failure. err is always 0x07 which is
DFB_ACCESSDENIED,   /* Access to the resource is denied. */

Can someone tell me what I'm doing wrong here and how to proceed?

thanks in advance for your help
Dhoti




_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to