Mercurial > sdl-ios-xcode
annotate docs/man3/SDL_CreateCursor.3 @ 1135:cf6133247d34
Mac Classic and CodeWarrior patches.
--ryan.
From: =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb@algonet.se>
Subject: Re: [SDL] Updated Mac patch
Date: Tue, 6 Sep 2005 15:21:27 +0200
To: A list for developers using the SDL library <sdl@libsdl.org>
Earlier, I wrote:
> Updated the previous Mac patch to disable Carbon by default.
> Also "fixed" the SDL.spec again, so that it builds on Darwin.
>
> http://www.algonet.se/~afb/SDL-1.2.9-mac.patch
> Also applied fine to SDL12 CVS, when I tried it.
>
> Haven't completed any new packaging or projects for Xcode/PB,
> but it seems to build and install fine here (in development).
Tested the new patch to build with old CodeWarrior and MPW,
and it seems it needed some hacks with those old headers...
Just in case you want to support the archeological versions -
here is a small add-on to the above patch, to fix those...
http://www.algonet.se/~afb/SDL-1.2.9-classic.patch
I couldn't get the old CW5 projects to build without a few
modifications - such as deleting the stray old header in:
"CWprojects/Support/Carbon/Include/ConditionalMacros.h" ?
But I updated both projects to CW6 too and built for Carbon,
and it ran all of the Mac test projects without any problems.
The MPW file seems to have compiled, with a small order change.
As long as you're still shipping the CWProjects and MPWmake
with the download, they should probably be updated/fixed ?
(another "solution" would of course be to just delete them)
I'll post my new projects along with the new Xcode projects
later on, along with XML exports of the various .mcp files.
(CW5 builds for Classic / "PPC", and CW6 builds for Carbon)
It'll be packaged as a part of the next SpriteWorld X release...
http://spriteworldx.sourceforge.net/ [Classic/Carbon/Win/X11]
--anders
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Thu, 08 Sep 2005 06:34:28 +0000 |
parents | e5bc29de3f0a |
children | 546f7c1eb755 |
rev | line source |
---|---|
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
1 .TH "SDL_CreateCursor" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" |
0 | 2 .SH "NAME" |
3 SDL_CreateCursor\- Creates a new mouse cursor\&. | |
4 .SH "SYNOPSIS" | |
5 .PP | |
6 \fB#include "SDL\&.h" | |
7 .sp | |
8 \fBSDL_Cursor *\fBSDL_CreateCursor\fP\fR(\fBUint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y\fR); | |
9 .SH "DESCRIPTION" | |
10 .PP | |
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\&. | |
12 .PP | |
13 The cursor is created in black and white according to the following: | |
14 .TP 20 | |
15 \fBData / Mask\fR | |
16 \fBResulting pixel on screen\fR | |
17 .TP 20 | |
18 0 / 1 | |
19 White | |
20 .TP 20 | |
21 1 / 1 | |
22 Black | |
23 .TP 20 | |
24 0 / 0 | |
25 Transparent | |
26 .TP 20 | |
27 1 / 0 | |
28 Inverted color if possible, black if not\&. | |
29 .PP | |
30 Cursors created with this function must be freed with \fISDL_FreeCursor\fR\&. | |
31 .SH "EXAMPLE" | |
32 .PP | |
33 .nf | |
34 \f(CW/* Stolen from the mailing list */ | |
35 /* Creates a new mouse cursor from an XPM */ | |
36 | |
37 | |
38 /* XPM */ | |
39 static const char *arrow[] = { | |
40 /* width height num_colors chars_per_pixel */ | |
41 " 32 32 3 1", | |
42 /* colors */ | |
43 "X c #000000", | |
44 "\&. c #ffffff", | |
45 " c None", | |
46 /* pixels */ | |
47 "X ", | |
48 "XX ", | |
49 "X\&.X ", | |
50 "X\&.\&.X ", | |
51 "X\&.\&.\&.X ", | |
52 "X\&.\&.\&.\&.X ", | |
53 "X\&.\&.\&.\&.\&.X ", | |
54 "X\&.\&.\&.\&.\&.\&.X ", | |
55 "X\&.\&.\&.\&.\&.\&.\&.X ", | |
56 "X\&.\&.\&.\&.\&.\&.\&.\&.X ", | |
57 "X\&.\&.\&.\&.\&.XXXXX ", | |
58 "X\&.\&.X\&.\&.X ", | |
59 "X\&.X X\&.\&.X ", | |
60 "XX X\&.\&.X ", | |
61 "X X\&.\&.X ", | |
62 " X\&.\&.X ", | |
63 " X\&.\&.X ", | |
64 " X\&.\&.X ", | |
65 " XX ", | |
66 " ", | |
67 " ", | |
68 " ", | |
69 " ", | |
70 " ", | |
71 " ", | |
72 " ", | |
73 " ", | |
74 " ", | |
75 " ", | |
76 " ", | |
77 " ", | |
78 " ", | |
79 "0,0" | |
80 }; | |
81 | |
82 static SDL_Cursor *init_system_cursor(const char *image[]) | |
83 { | |
84 int i, row, col; | |
85 Uint8 data[4*32]; | |
86 Uint8 mask[4*32]; | |
87 int hot_x, hot_y; | |
88 | |
89 i = -1; | |
90 for ( row=0; row<32; ++row ) { | |
91 for ( col=0; col<32; ++col ) { | |
92 if ( col % 8 ) { | |
93 data[i] <<= 1; | |
94 mask[i] <<= 1; | |
95 } else { | |
96 ++i; | |
97 data[i] = mask[i] = 0; | |
98 } | |
99 switch (image[4+row][col]) { | |
100 case \&'X\&': | |
101 data[i] |= 0x01; | |
102 k[i] |= 0x01; | |
103 break; | |
104 case \&'\&.\&': | |
105 mask[i] |= 0x01; | |
106 break; | |
107 case \&' \&': | |
108 break; | |
109 } | |
110 } | |
111 } | |
112 sscanf(image[4+row], "%d,%d", &hot_x, &hot_y); | |
113 return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y); | |
114 }\fR | |
115 .fi | |
116 .PP | |
117 .SH "SEE ALSO" | |
118 .PP | |
119 \fI\fBSDL_FreeCursor\fP\fR, \fI\fBSDL_SetCursor\fP\fR, \fI\fBSDL_ShowCursor\fP\fR | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
120 ...\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01 |