1select_mouse_cursor(3) Allegro manual select_mouse_cursor(3)
2
3
4
6 select_mouse_cursor - Tells Allegro to select software or hardware cur‐
7 sor drawing.
8
10 #include <allegro.h>
11
12
13 void select_mouse_cursor(int cursor);
14
16 This function allows you to use the operating system's native mouse
17 cursors rather than some custom cursor. You will need to enable this
18 functionality by calling enable_hardware_cursor() beforehand. If the
19 operating system does not support this functionality, or if it has not
20 been enabled, then Allegro will substitute its own cursor images. You
21 can change these substitute images using set_mouse_cursor_bitmap().
22
23 Note that the effects of this function are not apparent until
24 show_mouse() is called.
25
26 To know whether the operating system's native cursor is being used, or
27 if Allegro has made a substitution, you can check the GFX_SYSTEM_CURSOR
28 flag in gfx_capabilities after calling show_mouse().
29
30 The cursor argument selects the type of cursor to be displayed:
31
32 MOUSE_CURSOR_NONE Selects an invisible mouse cursor. In that sense, it
33 is similar to calling show_mouse(NULL);
34
35 MOUSE_CURSOR_ALLEGRO Selects the custom Allegro cursor, i.e. the one
36 that you set with set_mouse_sprite().
37
38 MOUSE_CURSOR_ARROW The operating system default arrow cursor.
39
40 MOUSE_CURSOR_BUSY The operating system default `busy' cursor (hour‐
41 glass).
42
43 MOUSE_CURSOR_QUESTION The operating system default `question' cursor
44 (arrow with question mark).
45
46 MOUSE_CURSOR_EDIT The operating system default `edit' cursor (vertical
47 bar).
48
49 Example:
50
51 /* initialize mouse sub-system */
52 install_mouse();
53 enable_hardware_cursor();
54
55 /* Set busy pointer */
56 select_mouse_cursor(MOUSE_CURSOR_BUSY);
57 show_mouse(screen);
58
59 /* Initialize stuff */
60 ...
61
62 /* Set normal arrow pointer */
63 select_mouse_cursor(MOUSE_CURSOR_ARROW);
64
65
66
68 install_mouse(3), show_mouse(3), set_mouse_sprite(3), gfx_capabili‐
69 ties(3), enable_hardware_cursor(3), set_mouse_cursor_bitmap(3),
70 show_os_cursor(3), exsyscur(3)
71
72
73
74Allegro version 4.2.2 select_mouse_cursor(3)