1 .TH "SDL_CreateCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
3 SDL_CreateCursor\- Creates a new mouse cursor\&.
8 \fBSDL_Cursor *\fBSDL_CreateCursor\fP\fR(\fBUint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y\fR);
11 Create a cursor using the specified \fBdata\fR and \fBmask\fR (in MSB format)\&. The cursor width must be a multiple of 8 bits\&.
13 The cursor is created in black and white according to the following:
16 \fBResulting pixel on screen\fR
28 Inverted color if possible, black if not\&.
30 Cursors created with this function must be freed with \fISDL_FreeCursor\fR\&.
34 \f(CW/* Stolen from the mailing list */
35 /* Creates a new mouse cursor from an XPM */
39 static const char *arrow[] = {
40 /* width height num_colors chars_per_pixel */
54 "X\&.\&.\&.\&.\&.\&.X ",
55 "X\&.\&.\&.\&.\&.\&.\&.X ",
56 "X\&.\&.\&.\&.\&.\&.\&.\&.X ",
57 "X\&.\&.\&.\&.\&.XXXXX ",
82 static SDL_Cursor *init_system_cursor(const char *image[])
90 for ( row=0; row<32; ++row ) {
91 for ( col=0; col<32; ++col ) {
97 data[i] = mask[i] = 0;
99 switch (image[4+row][col]) {
112 sscanf(image[4+row], "%d,%d", &hot_x, &hot_y);
113 return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
119 \fI\fBSDL_FreeCursor\fP\fR, \fI\fBSDL_SetCursor\fP\fR, \fI\fBSDL_ShowCursor\fP\fR
120 ...\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01