Mercurial > sdl-ios-xcode
annotate docs/html/sdlquitevent.html @ 4167:a6f635e5eaa6 SDL-1.2
Fixed bug #611
From Tim Angus 2008-08-12 11:18:06
I'm one of the maintainers of ioquake3.org, an updated version of the
Quake 3 engine. Relatively recently, we moved ioq3 to use SDL as a
replacement for 95% of the platform specific code that was there. On the
whole it's doing a great job but unfortunately since the move we've been
getting complaints about the quality of the mouse input on the Windows
platform to the point where for many the game is unplayable. Put in
other terms, the current stable SDL 1.2 is basically not fit for purpose
if you need high quality mouse input as you do in a first person shooter.
Over the weekend I decided to pull my finger out and actually figure out
what's going on. There are basically two major problems. Firstly, when
using the "windib" driver, mouse input is gathered via the WM_MOUSEMOVE
message. Googling for this indicates that often this is known to result
in "spurious" and/or "missing" mouse movement events; this is the
primary cause of the poor mouse input. The second problem is that the
"directx" driver does not work at all in combination with OpenGL meaning
that you can't use DirectInput if your application also uses OpenGL. In
other words you're locked into using the "windib" driver and its poor
mouse input.
In order to address these problems I've done the following:
* Remove WM_MOUSEMOVE based motion event generation and replace with
calls to GetCursorPos which seems much more reliable. In order to
achieve this I've moved mouse motion out into a separate function that
is called once per DIB_PumpEvents.
* Remove the restriction on the "directx" driver being inoperable in
combination with OpenGL. There is a bug for this issues that I've
hijacked to a certain extent
(http://bugzilla.libsdl.org/show_bug.cgi?id=265). I'm the first to admit
I don't really understand why this restriction is there in the first
place. The commit message for the bug fix that introduced this
restriction (r581) isn't very elaborate and I couldn't see any other bug
tracking the issue. If anyone has more information on the bug that was
avoided by r581 it would be helpful as I/someone could then look into
addressing the problem without disabling the "directx" driver.
* I've also removed the restriction on not being allowed to use
DirectInput in windowed mode. I couldn't see any reason for this, at
least not from our perspective. I have my suspicions that it'll be
something like matching up the cursor with the mouse coordinates...
* I bumped up the DirectInput API used to version 7 in order to get
access to mouse buttons 4-7. I've had to inject a little bit of the DX7
headers into SDL there as the MinGW ones aren't up to date in this respect.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 02 Apr 2009 04:43:36 +0000 |
parents | 355632dca928 |
children |
rev | line source |
---|---|
0 | 1 <HTML |
2 ><HEAD | |
3 ><TITLE | |
4 >SDL_QuitEvent</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="SDL Event Structures." | |
14 HREF="eventstructures.html"><LINK | |
15 REL="PREVIOUS" | |
16 TITLE="SDL_UserEvent" | |
17 HREF="sdluserevent.html"><LINK | |
18 REL="NEXT" | |
19 TITLE="SDL_keysym" | |
20 HREF="sdlkeysym.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="sdluserevent.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="sdlkeysym.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="SDLQUITEVENT" | |
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_QuitEvent</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="AEN4621" |
0 | 80 ></A |
81 ><H2 | |
82 >Name</H2 | |
83 >SDL_QuitEvent -- Quit requested event</DIV | |
84 ><DIV | |
85 CLASS="REFSECT1" | |
86 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
87 NAME="AEN4624" |
0 | 88 ></A |
89 ><H2 | |
90 >Structure Definition</H2 | |
91 ><PRE | |
92 CLASS="PROGRAMLISTING" | |
93 >typedef struct{ | |
94 Uint8 type | |
95 } SDL_QuitEvent;</PRE | |
96 ></DIV | |
97 ><DIV | |
98 CLASS="REFSECT1" | |
99 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
100 NAME="AEN4627" |
0 | 101 ></A |
102 ><H2 | |
103 >Structure Data</H2 | |
104 ><DIV | |
105 CLASS="INFORMALTABLE" | |
106 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
107 NAME="AEN4629" |
0 | 108 ></A |
109 ><P | |
110 ></P | |
111 ><TABLE | |
112 BORDER="0" | |
113 CLASS="CALSTABLE" | |
114 ><TBODY | |
115 ><TR | |
116 ><TD | |
117 ALIGN="LEFT" | |
118 VALIGN="TOP" | |
119 ><TT | |
120 CLASS="STRUCTFIELD" | |
121 ><I | |
122 >type</I | |
123 ></TT | |
124 ></TD | |
125 ><TD | |
126 ALIGN="LEFT" | |
127 VALIGN="TOP" | |
128 ><TT | |
129 CLASS="LITERAL" | |
130 >SDL_QUIT</TT | |
131 ></TD | |
132 ></TR | |
133 ></TBODY | |
134 ></TABLE | |
135 ><P | |
136 ></P | |
137 ></DIV | |
138 ></DIV | |
139 ><DIV | |
140 CLASS="REFSECT1" | |
141 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
142 NAME="AEN4637" |
0 | 143 ></A |
144 ><H2 | |
145 >Description</H2 | |
146 ><P | |
147 ><SPAN | |
148 CLASS="STRUCTNAME" | |
149 >SDL_QuitEvent</SPAN | |
150 > is a member of the <A | |
151 HREF="sdlevent.html" | |
152 ><SPAN | |
153 CLASS="STRUCTNAME" | |
154 >SDL_Event</SPAN | |
155 ></A | |
156 > union and is used whan an event of type <TT | |
157 CLASS="LITERAL" | |
158 >SDL_QUIT</TT | |
159 > is reported.</P | |
160 ><P | |
161 >As can be seen, the SDL_QuitEvent structure serves no useful purpose. The event itself, on the other hand, is very important. If you filter out or ignore a quit event then it is impossible for the user to close the window. On the other hand, if you do accept a quit event then the application window will be closed, and screen updates will still report success event though the application will no longer be visible.</P | |
162 ><DIV | |
163 CLASS="NOTE" | |
164 ><BLOCKQUOTE | |
165 CLASS="NOTE" | |
166 ><P | |
167 ><B | |
168 >Note: </B | |
169 >The macro <TT | |
170 CLASS="FUNCTION" | |
171 >SDL_QuitRequested</TT | |
172 > will return non-zero if a quit event is pending</P | |
173 ></BLOCKQUOTE | |
174 ></DIV | |
175 ></DIV | |
176 ><DIV | |
177 CLASS="REFSECT1" | |
178 ><A | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
179 NAME="AEN4648" |
0 | 180 ></A |
181 ><H2 | |
182 >See Also</H2 | |
183 ><P | |
184 ><A | |
185 HREF="sdlevent.html" | |
186 ><SPAN | |
187 CLASS="STRUCTNAME" | |
188 >SDL_Event</SPAN | |
189 ></A | |
190 >, | |
191 <A | |
192 HREF="sdlseteventfilter.html" | |
193 ><TT | |
194 CLASS="FUNCTION" | |
195 >SDL_SetEventFilter</TT | |
196 ></A | |
197 ></P | |
198 ></DIV | |
199 ><DIV | |
200 CLASS="NAVFOOTER" | |
201 ><HR | |
202 ALIGN="LEFT" | |
203 WIDTH="100%"><TABLE | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
204 SUMMARY="Footer navigation table" |
0 | 205 WIDTH="100%" |
206 BORDER="0" | |
207 CELLPADDING="0" | |
208 CELLSPACING="0" | |
209 ><TR | |
210 ><TD | |
211 WIDTH="33%" | |
212 ALIGN="left" | |
213 VALIGN="top" | |
214 ><A | |
215 HREF="sdluserevent.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
216 ACCESSKEY="P" |
0 | 217 >Prev</A |
218 ></TD | |
219 ><TD | |
220 WIDTH="34%" | |
221 ALIGN="center" | |
222 VALIGN="top" | |
223 ><A | |
224 HREF="index.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
225 ACCESSKEY="H" |
0 | 226 >Home</A |
227 ></TD | |
228 ><TD | |
229 WIDTH="33%" | |
230 ALIGN="right" | |
231 VALIGN="top" | |
232 ><A | |
233 HREF="sdlkeysym.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
234 ACCESSKEY="N" |
0 | 235 >Next</A |
236 ></TD | |
237 ></TR | |
238 ><TR | |
239 ><TD | |
240 WIDTH="33%" | |
241 ALIGN="left" | |
242 VALIGN="top" | |
243 >SDL_UserEvent</TD | |
244 ><TD | |
245 WIDTH="34%" | |
246 ALIGN="center" | |
247 VALIGN="top" | |
248 ><A | |
249 HREF="eventstructures.html" | |
803
355632dca928
Updated SDL HTML documentation
Sam Lantinga <slouken@libsdl.org>
parents:
181
diff
changeset
|
250 ACCESSKEY="U" |
0 | 251 >Up</A |
252 ></TD | |
253 ><TD | |
254 WIDTH="33%" | |
255 ALIGN="right" | |
256 VALIGN="top" | |
257 >SDL_keysym</TD | |
258 ></TR | |
259 ></TABLE | |
260 ></DIV | |
261 ></BODY | |
262 ></HTML | |
263 > |