Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Mouse dissappears in Linux

This thread is locked; no one can reply to it. rss feed Print
Mouse dissappears in Linux
Zdravko
Member #6,994
March 2006
avatar

Having this code, how can I enable the mouse cursor under Linux environment?

allegro_init();
install_timer();
install_keyboard();
set_color_depth(8);
set_window_title("my program");
set_gfx_mode(GFX_AUTODETECT, 800, 600, 0, 0);
BITMAP* buffer_=create_bitmap(800, 600);
show_mouse(screen);
blit(buffer_, screen, 0, 0, 0, 0, 800, 600);

Evert
Member #794
November 2000
avatar

Call enable_hardware_cursor() before show_mouse().
This will make X11 draw the mouse cursor for you, instead of using Allegro's software mouse. When dealing with a software mouse, you need to call scare_mouse() (or scare_mouse_area()) before blitting to the screen and unscare_mouse() afterwards.

Go to: