Mercurial > sdl-ios-xcode
annotate docs/html/sdlsetcliprect.html @ 615:7ec821f3cbd0
Date: Thu, 17 Apr 2003 23:27:34 -0400
From: Darrell Walisser
Subject: Yet another OS X cursor bug
The synopsis:
1. Call SDL_ShowCursor(0);
2. Call SDL_SetVideoMode();
3. Call SDL_GetEvent();
3. Call SDL_ShowCursor(1);
The result: Sometimes the cursor doesn't come back! Ack! Oddly enough,
it does come back when mousing over the dock or clicking in the menu
bar. But that's besides the point.
The reason why this is happening is a flaw in the handling of
activation/deactivation events. The short explanation is that the
HideCursor() and ShowCursor() calls must be balanced, but if the cursor
was initially hidden, HideCursor() was called again on the activate
event - so now the next ShowCursor() fails (as does the next, and the
next, for some reason).
So, here's the patch. All it does is keep track of the
HideCursor()/ShowCursor() calls so that they will always be balanced.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 20 Apr 2003 05:41:16 +0000 |
parents | e5bc29de3f0a |
children | 355632dca928 |
rev | line source |
---|---|
0 | 1 <HTML |
2 ><HEAD | |
3 ><TITLE | |
4 >SDL_SetClipRect</TITLE | |
5 ><META | |
6 NAME="GENERATOR" | |
55
55f1f1b3e27d
Added new docs for SDL 1.2.1
Sam Lantinga <slouken@lokigames.com>
parents:
0
diff
changeset
|
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64 |
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_SetAlpha" | |
17 HREF="sdlsetalpha.html"><LINK | |
18 REL="NEXT" | |
19 TITLE="SDL_GetClipRect" | |
20 HREF="sdlgetcliprect.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 | |
31 WIDTH="100%" | |
32 BORDER="0" | |
33 CELLPADDING="0" | |
34 CELLSPACING="0" | |
35 ><TR | |
36 ><TH | |
37 COLSPAN="3" | |
38 ALIGN="center" | |
39 >SDL Library Documentation</TH | |
40 ></TR | |
41 ><TR | |
42 ><TD | |
43 WIDTH="10%" | |
44 ALIGN="left" | |
45 VALIGN="bottom" | |
46 ><A | |
47 HREF="sdlsetalpha.html" | |
48 >Prev</A | |
49 ></TD | |
50 ><TD | |
51 WIDTH="80%" | |
52 ALIGN="center" | |
53 VALIGN="bottom" | |
54 ></TD | |
55 ><TD | |
56 WIDTH="10%" | |
57 ALIGN="right" | |
58 VALIGN="bottom" | |
59 ><A | |
60 HREF="sdlgetcliprect.html" | |
61 >Next</A | |
62 ></TD | |
63 ></TR | |
64 ></TABLE | |
65 ><HR | |
66 ALIGN="LEFT" | |
67 WIDTH="100%"></DIV | |
68 ><H1 | |
69 ><A | |
70 NAME="SDLSETCLIPRECT" | |
71 >SDL_SetClipRect</A | |
72 ></H1 | |
73 ><DIV | |
74 CLASS="REFNAMEDIV" | |
75 ><A | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
76 NAME="AEN1815" |
0 | 77 ></A |
78 ><H2 | |
79 >Name</H2 | |
80 >SDL_SetClipRect -- Sets the clipping rectangle for a surface.</DIV | |
81 ><DIV | |
82 CLASS="REFSYNOPSISDIV" | |
83 ><A | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
84 NAME="AEN1818" |
0 | 85 ></A |
86 ><H2 | |
87 >Synopsis</H2 | |
88 ><DIV | |
89 CLASS="FUNCSYNOPSIS" | |
90 ><A | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
91 NAME="AEN1819" |
0 | 92 ></A |
93 ><P | |
94 ></P | |
95 ><PRE | |
96 CLASS="FUNCSYNOPSISINFO" | |
97 >#include "SDL.h"</PRE | |
98 ><P | |
99 ><CODE | |
100 ><CODE | |
101 CLASS="FUNCDEF" | |
102 >void <B | |
103 CLASS="FSFUNC" | |
104 >SDL_SetClipRect</B | |
105 ></CODE | |
106 >(SDL_Surface *surface, SDL_Rect *rect);</CODE | |
107 ></P | |
108 ><P | |
109 ></P | |
110 ></DIV | |
111 ></DIV | |
112 ><DIV | |
113 CLASS="REFSECT1" | |
114 ><A | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
115 NAME="AEN1825" |
0 | 116 ></A |
117 ><H2 | |
118 >Description</H2 | |
119 ><P | |
120 >Sets the clipping rectangle for a surface. When this surface is the | |
121 destination of a blit, only the area within the clip rectangle will be | |
122 drawn into.</P | |
123 ><P | |
124 >The rectangle pointed to by <TT | |
125 CLASS="PARAMETER" | |
126 ><I | |
127 >rect</I | |
128 ></TT | |
129 > will be | |
130 clipped to the edges of the surface so that the clip rectangle for a | |
131 surface can never fall outside the edges of the surface.</P | |
132 ><P | |
133 >If <TT | |
134 CLASS="PARAMETER" | |
135 ><I | |
136 >rect</I | |
137 ></TT | |
138 > is <TT | |
139 CLASS="LITERAL" | |
140 >NULL</TT | |
141 > the clipping | |
142 rectangle will be set to the full size of the surface.</P | |
143 ></DIV | |
144 ><DIV | |
145 CLASS="REFSECT1" | |
146 ><A | |
181
e5bc29de3f0a
Updated from the SDL Documentation Project
Sam Lantinga <slouken@libsdl.org>
parents:
55
diff
changeset
|
147 NAME="AEN1833" |
0 | 148 ></A |
149 ><H2 | |
150 >See Also</H2 | |
151 ><P | |
152 ><A | |
153 HREF="sdlgetcliprect.html" | |
154 ><TT | |
155 CLASS="FUNCTION" | |
156 >SDL_GetClipRect</TT | |
157 ></A | |
158 >, | |
159 <A | |
160 HREF="sdlblitsurface.html" | |
161 ><TT | |
162 CLASS="FUNCTION" | |
163 >SDL_BlitSurface</TT | |
164 ></A | |
165 >, | |
166 <A | |
167 HREF="sdlsurface.html" | |
168 ><SPAN | |
169 CLASS="STRUCTNAME" | |
170 >SDL_Surface</SPAN | |
171 ></A | |
172 ></P | |
173 ></DIV | |
174 ><DIV | |
175 CLASS="NAVFOOTER" | |
176 ><HR | |
177 ALIGN="LEFT" | |
178 WIDTH="100%"><TABLE | |
179 WIDTH="100%" | |
180 BORDER="0" | |
181 CELLPADDING="0" | |
182 CELLSPACING="0" | |
183 ><TR | |
184 ><TD | |
185 WIDTH="33%" | |
186 ALIGN="left" | |
187 VALIGN="top" | |
188 ><A | |
189 HREF="sdlsetalpha.html" | |
190 >Prev</A | |
191 ></TD | |
192 ><TD | |
193 WIDTH="34%" | |
194 ALIGN="center" | |
195 VALIGN="top" | |
196 ><A | |
197 HREF="index.html" | |
198 >Home</A | |
199 ></TD | |
200 ><TD | |
201 WIDTH="33%" | |
202 ALIGN="right" | |
203 VALIGN="top" | |
204 ><A | |
205 HREF="sdlgetcliprect.html" | |
206 >Next</A | |
207 ></TD | |
208 ></TR | |
209 ><TR | |
210 ><TD | |
211 WIDTH="33%" | |
212 ALIGN="left" | |
213 VALIGN="top" | |
214 >SDL_SetAlpha</TD | |
215 ><TD | |
216 WIDTH="34%" | |
217 ALIGN="center" | |
218 VALIGN="top" | |
219 ><A | |
220 HREF="video.html" | |
221 >Up</A | |
222 ></TD | |
223 ><TD | |
224 WIDTH="33%" | |
225 ALIGN="right" | |
226 VALIGN="top" | |
227 >SDL_GetClipRect</TD | |
228 ></TR | |
229 ></TABLE | |
230 ></DIV | |
231 ></BODY | |
232 ></HTML | |
233 > |