Mail Archives: djgpp/1997/06/08/08:38:51
In article <5ncmia$ees AT news DOT interlog DOT com>,
Gautam N. Lad <gautam AT interlog DOT com> wrote:
>
>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.
^^^^^^^^^^^^^^^^^^^^^^^^^^
That is exactly the condition that you can't use that flag for. It will prevent
mouse movements from being drawn, but does not hide the mouse. If the mouse
is *on* the area you are drawing, use show_mouse( NULL ); show_mouse( screen );
In C++, try using this class (From my own Allegro-helper header)
#if !defined alleg_mouse_unused
extern BITMAP * _mouse_screen; //For now, from internal.h
struct
hold_that_mouse
{
hold_that_mouse( void )
: old_mouse_screen( _mouse_screen )
{ show_mouse( NULL ); };
~hold_that_mouse( void )
{ show_mouse( old_mouse_screen ); };
BITMAP * old_mouse_screen;
};
const int mouse_left_button = 0x01;
const int mouse_right_button = 0x02;
#endif /* !defined alleg_mouse_unused */
Tom
- Raw text -