Pt_ARG_BITMAP_CURSOR

Hi everybody,

I would like to use a custom cursor in my application. I’ve tried to set
the Pt_ARG_CURSOR_TYPE of my region to Ph_CURSOR_BITMAP and the
Pt_ARG_BITMAP_CURSOR by the following fragment of code :

char pix_verrou [] = {
0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
};

curs = malloc (sizeof (PhCursorDef_t) + sizeof (pix_verrou));
memset (curs, 0, sizeof (PhCursorDef_t));
curs → size1.x = 8;
curs → size1.y = 8;
curs → color1 = Pg_GREEN;
curs → bytesperline1 = 1;


memcpy (curs → images, pix_verrou, sizeof (pix_verrou));

PtSetArg (&arg[n++], Pt_ARG_BITMAP_CURSOR, curs,
sizeof(PhCursorDef_t) + sizeof (pix_verrou) - 1);

After that, I hope to have a 8x8 diagonal cursor, but I only have 4
green pixels.

How the cursor plane must be initialized ?
Is there any samples of using a custom cursor ?

Pierre AUBERT a écrit :

Hi everybody,

I would like to use a custom cursor in my application. I’ve tried to
set the Pt_ARG_CURSOR_TYPE of my region to Ph_CURSOR_BITMAP and the
Pt_ARG_BITMAP_CURSOR by the following fragment of code :

char pix_verrou [] = {
0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01,
};

curs = malloc (sizeof (PhCursorDef_t) + sizeof (pix_verrou));
memset (curs, 0, sizeof (PhCursorDef_t));
curs → size1.x = 8;
curs → size1.y = 8;
curs → color1 = Pg_GREEN;
curs → bytesperline1 = 1;


memcpy (curs → images, pix_verrou, sizeof (pix_verrou));

PtSetArg (&arg[n++], Pt_ARG_BITMAP_CURSOR, curs,
sizeof(PhCursorDef_t) + sizeof (pix_verrou) - 1);

After that, I hope to have a 8x8 diagonal cursor, but I only have 4
green pixels.

How the cursor plane must be initialized ?
Is there any samples of using a custom cursor ?

This problem appears only on a PPC target, it works fine on an x86 RTP.