4 >SDL_CreateCursor</TITLE
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
10 TITLE="SDL Library Documentation"
11 HREF="index.html"><LINK
14 HREF="video.html"><LINK
17 HREF="sdlwarpmouse.html"><LINK
19 TITLE="SDL_FreeCursor"
20 HREF="sdlfreecursor.html"></HEAD
31 SUMMARY="Header navigation table"
40 >SDL Library Documentation</TH
48 HREF="sdlwarpmouse.html"
62 HREF="sdlfreecursor.html"
73 NAME="SDLCREATECURSOR"
83 >SDL_CreateCursor -- Creates a new mouse cursor.</DIV
85 CLASS="REFSYNOPSISDIV"
99 CLASS="FUNCSYNOPSISINFO"
100 >#include "SDL.h"</PRE
109 >(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);</CODE
123 >Create a cursor using the specified <TT
134 The cursor width must be a multiple of 8 bits.</P
136 >The cursor is created in black and white according to the following:
138 CLASS="INFORMALTABLE"
156 >Resulting pixel on screen</TH
198 >Inverted color if possible, black if not.</TD
207 >Cursors created with this function must be freed with
209 HREF="sdlfreecursor.html"
221 CLASS="PROGRAMLISTING"
222 >/* Stolen from the mailing list */
223 /* Creates a new mouse cursor from an XPM */
227 static const char *arrow[] = {
228 /* width height num_colors chars_per_pixel */
270 static SDL_Cursor *init_system_cursor(const char *image[])
278 for ( row=0; row<32; ++row ) {
279 for ( col=0; col<32; ++col ) {
281 data[i] <<= 1;
282 mask[i] <<= 1;
285 data[i] = mask[i] = 0;
287 switch (image[4+row][col]) {
300 sscanf(image[4+row], "%d,%d", &hot_x, &hot_y);
301 return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y);
313 HREF="sdlfreecursor.html"
320 HREF="sdlsetcursor.html"
327 HREF="sdlshowcursor.html"
339 SUMMARY="Footer navigation table"
350 HREF="sdlwarpmouse.html"
368 HREF="sdlfreecursor.html"