[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] todo.txt
- From: Trent Gamblin <trentgamblin@xxxxxxxxxx>
- Date: Tue, 09 May 2006 17:58:24 -0600
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=Q0GgPLdOJUsdt3bvKa75FQYOknev8SsPjUecE2pxkLoiqxu0hM4MZtJD0Xg+v3xpYzL6vKE+813tDv/y+9Rb1CSjUT2ufsTBDCPVoW5Ea6enwe9WRQLS/CUOMdqP6nYgyrtc/ohOOkpMF5XK/tneRCKjZ8JVU1dsSD15JDyfghg= ;
Evert Glebbeek wrote:
- Investigate mouse problem reported in
http://www.allegro.cc/forums/view_thread.php?_id=459972
Same question.
The example linked to works if you call show_mouse(screen) before
destroying canvas.
- Mouse problems in Windows reported in
http://www.allegro.cc/forums/view_thread.php?_id=497651
I think this was fixed. Can someone with Windows check this?
This little program works so I think it is fixed. It doesn't work
without the
calls to show_mouse(screen) in my_proc.
#include <allegro.h>
BITMAP *cursor;
int my_proc(int msg, DIALOG *d, int c)
{
static int curr = 1;
if ((mouse_x < 150) && curr) {
set_mouse_sprite(cursor);
set_mouse_sprite_focus(4, 4);
show_mouse(screen);
curr = 0;
}
else if ((mouse_x >= 150) && !curr) {
set_mouse_sprite(NULL);
set_mouse_sprite_focus(0, 0);
show_mouse(screen);
curr = 1;
}
return D_O_K;
}
DIALOG d[] = {
{ d_button_proc, 100, 100, 100, 20, 0, 0, 0, D_EXIT,
0, 0, (void *)"Test", NULL, NULL },
{ my_proc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL },
{ NULL, }
};
int main(void)
{
allegro_init();
install_mouse();
set_color_depth(32);
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
cursor = load_bitmap("cursor.bmp", NULL);
enable_hardware_cursor();
set_dialog_color(d, gui_fg_color, gui_bg_color);
show_mouse(screen);
do_dialog(d, 0);
allegro_exit();
return 0;
}
END_OF_MAIN();