Mercurial > sdl-ios-xcode
annotate docs/html/sdlconvertsurface.html @ 983:7f08bd66f1ca
Date: Fri, 19 Nov 2004 06:23:53 -0800 (PST)
From: Eric Wing
Subject: OS X Mouse inversion problem fix (again)
Here's yet another patch for the OS X mouse inversion
problem. This should fix the problem once and for all.
I know I've said this before, but *This time for
sure!* :)
If you recall, my last patch broke the non-OpenGL
windowed code and caused the inversion to occur there
instead. Max submitted a patch that partially reverted
the changes back which included the os version hack
which is currently the most recent CVS.
Aaron Sullivan identified and reported to the mailing
list the other day, that the last partial regression
of the code broke OS X 10.2. Looking over the results,
I'm thinking that I was slightly more successful than
I thought at unifying the code. I think I was trying
to unify the code base for OpenGL and non-OpenGL
windowed modes for all versions of the OS. It looks
like I failed at at unifying the OpenGL and non-OpenGL
code, but I did succeed at unifying the OS versions.
Thus, we no longer need the hack for the OS version
checks. The partial regression still included an OS
check which is what broke things for < 10.3.
Attached is the patch for SDL_QuartzWM.m. It basically
is a half-line change that removes one of the two
checks that decides if the mouse coordinates need to
be inverted, i.e:
if (system_version >= 0x1030 &&
(SDL_VideoSurface->flags & SDL_OPENGL) )
becomes this:
if(SDL_VideoSurface->flags & SDL_OPENGL)
With Aaron's outstanding help, we have collectively
tested:
windowed OpenGL
windowed non-OpenGL
fullscreen OpenGL
fullscreen non-OpenGL
under OS X 10.2 (Jaguar), 10.3 (Panther), and 10.4
(Tiger).
We don't have access to 10.0 or 10.1, but since the
original problem didn't materialize until 10.3, I'm
hopeful that testing 10.2 is sufficient. And now that
the code is uniform, I'm also hoping we'll be safe
moving forward to deal with future revisions of the OS
with this issue.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 21 Nov 2004 00:57:47 +0000 |
parents | 355632dca928 |
children |
rev | line source |
---|---|
0 | 1 <HTML |
2 ><HEAD | |
3 ><TITLE | |
4 >SDL_ConvertSurface</TITLE | |
5 ><META | |
6 NAME="GENERATOR" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ |
0 | 8 "><LINK |
9 REL="HOME" | |
10 TITLE="SDL Library Documentation" | |
11 HREF="index.html"><LINK | |
12 REL="UP" | |
13 TITLE="Video" | |
14 HREF="video.html"><LINK | |
15 REL="PREVIOUS" | |
16 TITLE="SDL_GetClipRect" | |
17 HREF="sdlgetcliprect.html"><LINK | |
18 REL="NEXT" | |
19 TITLE="SDL_BlitSurface" | |
20 HREF="sdlblitsurface.html"></HEAD | |
21 ><BODY | |
22 CLASS="REFENTRY" | |
23 BGCOLOR="#FFF8DC" | |
24 TEXT="#000000" | |
25 LINK="#0000ee" | |
26 VLINK="#551a8b" | |
27 ALINK="#ff0000" | |
28 ><DIV | |
29 CLASS="NAVHEADER" | |
30 ><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
31 SUMMARY="Header navigation table" |
0 | 32 WIDTH="100%" |
33 BORDER="0" | |
34 CELLPADDING="0" | |
35 CELLSPACING="0" | |
36 ><TR | |
37 ><TH | |
38 COLSPAN="3" | |
39 ALIGN="center" | |
40 >SDL Library Documentation</TH | |
41 ></TR | |
42 ><TR | |
43 ><TD | |
44 WIDTH="10%" | |
45 ALIGN="left" | |
46 VALIGN="bottom" | |
47 ><A | |
48 HREF="sdlgetcliprect.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
49 ACCESSKEY="P" |
0 | 50 >Prev</A |
51 ></TD | |
52 ><TD | |
53 WIDTH="80%" | |
54 ALIGN="center" | |
55 VALIGN="bottom" | |
56 ></TD | |
57 ><TD | |
58 WIDTH="10%" | |
59 ALIGN="right" | |
60 VALIGN="bottom" | |
61 ><A | |
62 HREF="sdlblitsurface.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
63 ACCESSKEY="N" |
0 | 64 >Next</A |
65 ></TD | |
66 ></TR | |
67 ></TABLE | |
68 ><HR | |
69 ALIGN="LEFT" | |
70 WIDTH="100%"></DIV | |
71 ><H1 | |
72 ><A | |
73 NAME="SDLCONVERTSURFACE" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
74 ></A |
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
75 >SDL_ConvertSurface</H1 |
0 | 76 ><DIV |
77 CLASS="REFNAMEDIV" | |
78 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
79 NAME="AEN2258" |
0 | 80 ></A |
81 ><H2 | |
82 >Name</H2 | |
83 >SDL_ConvertSurface -- Converts a surface to the same format as another surface.</DIV | |
84 ><DIV | |
85 CLASS="REFSYNOPSISDIV" | |
86 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
87 NAME="AEN2261" |
0 | 88 ></A |
89 ><H2 | |
90 >Synopsis</H2 | |
91 ><DIV | |
92 CLASS="FUNCSYNOPSIS" | |
93 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
94 NAME="AEN2262" |
0 | 95 ></A |
96 ><P | |
97 ></P | |
98 ><PRE | |
99 CLASS="FUNCSYNOPSISINFO" | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
100 >#include "SDL/SDL.h"</PRE |
0 | 101 ><P |
102 ><CODE | |
103 ><CODE | |
104 CLASS="FUNCDEF" | |
105 >SDL_Surface *<B | |
106 CLASS="FSFUNC" | |
107 >SDL_ConvertSurface</B | |
108 ></CODE | |
109 >(SDL_Surface *src, SDL_PixelFormat *fmt, Uint32 flags);</CODE | |
110 ></P | |
111 ><P | |
112 ></P | |
113 ></DIV | |
114 ></DIV | |
115 ><DIV | |
116 CLASS="REFSECT1" | |
117 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
118 NAME="AEN2268" |
0 | 119 ></A |
120 ><H2 | |
121 >Description</H2 | |
122 ><P | |
123 >Creates a new surface of the specified format, and then copies and maps | |
124 the given surface to it. If this function fails, it returns | |
125 <TT | |
126 CLASS="LITERAL" | |
127 >NULL</TT | |
128 >.</P | |
129 ><P | |
130 >The <TT | |
131 CLASS="PARAMETER" | |
132 ><I | |
133 >flags</I | |
134 ></TT | |
135 > parameter is passed to | |
136 <A | |
137 HREF="sdlcreatergbsurface.html" | |
138 ><TT | |
139 CLASS="FUNCTION" | |
140 >SDL_CreateRGBSurface</TT | |
141 ></A | |
142 > | |
143 and has those semantics.</P | |
144 ><P | |
145 >This function is used internally by | |
146 <A | |
147 HREF="sdldisplayformat.html" | |
148 ><TT | |
149 CLASS="FUNCTION" | |
150 >SDL_DisplayFormat</TT | |
151 ></A | |
152 >.</P | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
153 ><P |
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
154 >This function can only be called after SDL_Init.</P |
0 | 155 ></DIV |
156 ><DIV | |
157 CLASS="REFSECT1" | |
158 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
159 NAME="AEN2280" |
0 | 160 ></A |
161 ><H2 | |
162 >Return Value</H2 | |
163 ><P | |
164 >Returns either a pointer to the new surface, or | |
165 <TT | |
166 CLASS="LITERAL" | |
167 >NULL</TT | |
168 > on error.</P | |
169 ></DIV | |
170 ><DIV | |
171 CLASS="REFSECT1" | |
172 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
173 NAME="AEN2284" |
0 | 174 ></A |
175 ><H2 | |
176 >See Also</H2 | |
177 ><P | |
178 ><A | |
179 HREF="sdlcreatergbsurface.html" | |
180 ><TT | |
181 CLASS="FUNCTION" | |
182 >SDL_CreateRGBSurface</TT | |
183 ></A | |
184 >, | |
185 <A | |
186 HREF="sdldisplayformat.html" | |
187 ><TT | |
188 CLASS="FUNCTION" | |
189 >SDL_DisplayFormat</TT | |
190 ></A | |
191 >, | |
192 <A | |
193 HREF="sdlpixelformat.html" | |
194 ><SPAN | |
195 CLASS="STRUCTNAME" | |
196 >SDL_PixelFormat</SPAN | |
197 ></A | |
198 >, | |
199 <A | |
200 HREF="sdlsurface.html" | |
201 ><SPAN | |
202 CLASS="STRUCTNAME" | |
203 >SDL_Surface</SPAN | |
204 ></A | |
205 ></P | |
206 ></DIV | |
207 ><DIV | |
208 CLASS="NAVFOOTER" | |
209 ><HR | |
210 ALIGN="LEFT" | |
211 WIDTH="100%"><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
212 SUMMARY="Footer navigation table" |
0 | 213 WIDTH="100%" |
214 BORDER="0" | |
215 CELLPADDING="0" | |
216 CELLSPACING="0" | |
217 ><TR | |
218 ><TD | |
219 WIDTH="33%" | |
220 ALIGN="left" | |
221 VALIGN="top" | |
222 ><A | |
223 HREF="sdlgetcliprect.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
224 ACCESSKEY="P" |
0 | 225 >Prev</A |
226 ></TD | |
227 ><TD | |
228 WIDTH="34%" | |
229 ALIGN="center" | |
230 VALIGN="top" | |
231 ><A | |
232 HREF="index.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
233 ACCESSKEY="H" |
0 | 234 >Home</A |
235 ></TD | |
236 ><TD | |
237 WIDTH="33%" | |
238 ALIGN="right" | |
239 VALIGN="top" | |
240 ><A | |
241 HREF="sdlblitsurface.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
242 ACCESSKEY="N" |
0 | 243 >Next</A |
244 ></TD | |
245 ></TR | |
246 ><TR | |
247 ><TD | |
248 WIDTH="33%" | |
249 ALIGN="left" | |
250 VALIGN="top" | |
251 >SDL_GetClipRect</TD | |
252 ><TD | |
253 WIDTH="34%" | |
254 ALIGN="center" | |
255 VALIGN="top" | |
256 ><A | |
257 HREF="video.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
258 ACCESSKEY="U" |
0 | 259 >Up</A |
260 ></TD | |
261 ><TD | |
262 WIDTH="33%" | |
263 ALIGN="right" | |
264 VALIGN="top" | |
265 >SDL_BlitSurface</TD | |
266 ></TR | |
267 ></TABLE | |
268 ></DIV | |
269 ></BODY | |
270 ></HTML | |
271 > |