Mail Archives: djgpp/1997/06/09/19:47:53
In article <5ncmia$ees AT news DOT interlog DOT com>, gautam AT interlog DOT com (Gautam N. Lad) wrote:
>Hi,
>I'm making a simple tile/map editor, and I've a grid setup. When a user clicks
> on
>a grid, I do the following (psuedo code):
>
>if click is in range
> freeze_mouse_flag=TRUE; // Allegro extern variable for hiding/show mouse
> tblit(); // blit the sprite/tile
> freeze_mouse_flag=FALSE;
>
>For some reason, this won't work! The mouse hides, the bitmap gets drawn, and
>the mouse becomes visible again. The drawn bitmap still looks messed up,
> 'cause
>the drawn bitmap looks like the mouse is still over it.
>
>What am I doing wrong?
You're not hiding the mouse cursor, you're only preventing it from moving.
Try:
freeze_mouse_flag=TRUE; // Prevent the mouse from being moved
show_mouse(NULL); // Tells allegro to not draw the mouse
tblit();
show_mouse(screen); // Tells allegro it can draw the mouse again
freeze_mouse_flag=FALSE; // Let the mouse move again
You don't even need the freeze_mouse_*, but it doesn't hurt ;)
Hope this helps,
Andrew Ellem
krand at ican.net
- Raw text -