54 * Retrieve the current state of the mouse. |
54 * Retrieve the current state of the mouse. |
55 * The current button state is returned as a button bitmask, which can |
55 * The current button state is returned as a button bitmask, which can |
56 * be tested using the SDL_BUTTON(X) macros, and x and y are set to the |
56 * be tested using the SDL_BUTTON(X) macros, and x and y are set to the |
57 * current mouse cursor position. You can pass NULL for either x or y. |
57 * current mouse cursor position. You can pass NULL for either x or y. |
58 */ |
58 */ |
59 extern DECLSPEC Uint8 SDL_GetMouseState(int *x, int *y); |
59 extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); |
60 |
60 |
61 /* |
61 /* |
62 * Retrieve the current state of the mouse. |
62 * Retrieve the current state of the mouse. |
63 * The current button state is returned as a button bitmask, which can |
63 * The current button state is returned as a button bitmask, which can |
64 * be tested using the SDL_BUTTON(X) macros, and x and y are set to the |
64 * be tested using the SDL_BUTTON(X) macros, and x and y are set to the |
65 * mouse deltas since the last call to SDL_GetRelativeMouseState(). |
65 * mouse deltas since the last call to SDL_GetRelativeMouseState(). |
66 */ |
66 */ |
67 extern DECLSPEC Uint8 SDL_GetRelativeMouseState(int *x, int *y); |
67 extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); |
68 |
68 |
69 /* |
69 /* |
70 * Set the position of the mouse cursor (generates a mouse motion event) |
70 * Set the position of the mouse cursor (generates a mouse motion event) |
71 */ |
71 */ |
72 extern DECLSPEC void SDL_WarpMouse(Uint16 x, Uint16 y); |
72 extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y); |
73 |
73 |
74 /* |
74 /* |
75 * Create a cursor using the specified data and mask (in MSB format). |
75 * Create a cursor using the specified data and mask (in MSB format). |
76 * The cursor width must be a multiple of 8 bits. |
76 * The cursor width must be a multiple of 8 bits. |
77 * |
77 * |
82 * 0 0 Transparent |
82 * 0 0 Transparent |
83 * 1 0 Inverted color if possible, black if not. |
83 * 1 0 Inverted color if possible, black if not. |
84 * |
84 * |
85 * Cursors created with this function must be freed with SDL_FreeCursor(). |
85 * Cursors created with this function must be freed with SDL_FreeCursor(). |
86 */ |
86 */ |
87 extern DECLSPEC SDL_Cursor *SDL_CreateCursor |
87 extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor |
88 (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); |
88 (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y); |
89 |
89 |
90 /* |
90 /* |
91 * Set the currently active cursor to the specified one. |
91 * Set the currently active cursor to the specified one. |
92 * If the cursor is currently visible, the change will be immediately |
92 * If the cursor is currently visible, the change will be immediately |
93 * represented on the display. |
93 * represented on the display. |
94 */ |
94 */ |
95 extern DECLSPEC void SDL_SetCursor(SDL_Cursor *cursor); |
95 extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor); |
96 |
96 |
97 /* |
97 /* |
98 * Returns the currently active cursor. |
98 * Returns the currently active cursor. |
99 */ |
99 */ |
100 extern DECLSPEC SDL_Cursor * SDL_GetCursor(void); |
100 extern DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void); |
101 |
101 |
102 /* |
102 /* |
103 * Deallocates a cursor created with SDL_CreateCursor(). |
103 * Deallocates a cursor created with SDL_CreateCursor(). |
104 */ |
104 */ |
105 extern DECLSPEC void SDL_FreeCursor(SDL_Cursor *cursor); |
105 extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor *cursor); |
106 |
106 |
107 /* |
107 /* |
108 * Toggle whether or not the cursor is shown on the screen. |
108 * Toggle whether or not the cursor is shown on the screen. |
109 * The cursor start off displayed, but can be turned off. |
109 * The cursor start off displayed, but can be turned off. |
110 * SDL_ShowCursor() returns 1 if the cursor was being displayed |
110 * SDL_ShowCursor() returns 1 if the cursor was being displayed |
111 * before the call, or 0 if it was not. You can query the current |
111 * before the call, or 0 if it was not. You can query the current |
112 * state by passing a 'toggle' value of -1. |
112 * state by passing a 'toggle' value of -1. |
113 */ |
113 */ |
114 extern DECLSPEC int SDL_ShowCursor(int toggle); |
114 extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); |
115 |
115 |
116 /* Used as a mask when testing buttons in buttonstate |
116 /* Used as a mask when testing buttons in buttonstate |
117 Button 1: Left mouse button |
117 Button 1: Left mouse button |
118 Button 2: Middle mouse button |
118 Button 2: Middle mouse button |
119 Button 3: Right mouse button |
119 Button 3: Right mouse button |