Sam Lantinga
6956070880
Added a hint to control the Windows timer resolution: SDL_HINT_TIMER_RESOLUTION
...
Added an API to watch hint changes: SDL_AddHintCallback(), SDL_DelHintCallback()
You can now dynamically set the joystick background event hint.
2013-07-13 03:13:41 -07:00
Sam Lantinga
156a8638f0
Make it possible to use SDL events separately from the video subsystem.
2013-07-06 12:28:57 -07:00
Sam Lantinga
563185f19c
Only check for keyboard focus if the video subsystem was initialized.
...
Check the hint at initialization time, as an optimization. This isn't something we expect the application to change at runtime, and if it is we should add an API for it.
2013-06-28 23:29:13 -07:00
Sam Lantinga
5aa3492ef8
Fixed SDL building with the minimal configuration
2013-06-13 22:10:10 -07:00
Sam Lantinga
612ec5d29d
Slightly more efficient to check the event type first
2013-06-07 09:39:10 -07:00
Sam Lantinga
6879bf00c4
Fixed crash trying to get the GUID of an invalid joystick index
2013-06-06 18:20:06 -07:00
Jørgen P. Tjernø
e1e1fa3d61
Joystick: Only send joy events when focused.
...
This changes makes it so that you only receive joystick (and implicitly
gamecontroller) input events when your application has keyboard focus.
If you'd like to still receive events when your application is in the
background, set the SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS hint to "1".
This fixes http://bugzilla.libsdl.org/show_bug.cgi?id=1892
2013-06-05 15:11:38 -07:00
Sam Lantinga
0cb6385637
File style cleanup for the SDL 2.0 release
2013-05-18 14:17:52 -07:00
VALVE\alfred@alfredlinux.valvesoftware.com
3bf28ba7c8
- make sure to send a joy removed event even if the joystick wasn't opened under OSX
2013-04-22 15:24:35 -07:00
Ryan C. Gordon
4f438b70a2
Make SDL_SetError and friends unconditionally return -1.
...
This lets us change things like this...
if (Failed) {
SDL_SetError("We failed");
return -1;
}
...into this...
if (Failed) {
return SDL_SetError("We failed");
}
Fixes Bugzilla #1778 .
2013-03-31 12:48:50 -04:00
Sam Lantinga
95dcfa4c28
Happy New Year!
2013-02-15 08:47:44 -08:00
Sam Lantinga
80493dfae0
Only check SDL_SYS_JoystickNeedsPolling() if we know we don't need to poll for other reasons. This avoids a select() syscall on Linux if it isn't necessary.
2012-12-14 09:22:13 -08:00
Ryan C. Gordon
7cb9995377
Minor sanity checking and tweaks in SDL_JoystickGetGUIDString().
2012-12-11 18:46:09 -05:00
Sam Lantinga
89ef9e3168
Changes from Alfred:
...
- rename JoystickGUID -> SDL_JoystickGUID
- change SDL_JoystickGetGUIDString to take the string as an arg, rather than doing a malloc
2012-12-11 11:54:32 -08:00
Sam Lantinga
5417afcf11
Don't spam events if the axis values haven't changed
2012-12-11 10:49:54 -08:00
Sam Lantinga
556c764047
Fixed crashes in new joystick code
2012-11-28 11:52:38 -08:00
Sam Lantinga
03e08a6a79
Organized joystick hotplug code a bit.
...
Cleaned up names, return types, etc.
2012-11-27 00:58:12 -08:00
Sam Lantinga
968ccf93b1
Fixed iOS joystick support for new API
2012-11-26 21:11:28 -08:00
Sam Lantinga
34b88dfaae
Added hotplug joystick support and simplified game controller API, courtesy of Alfred Reynolds
2012-11-26 16:37:54 -08:00
Sam Lantinga
f380ecb137
Removed executable bit from source files
2012-09-27 14:35:28 -07:00
Sam Lantinga
5ef6f8e30f
Fixed bug 1337 - joystick crash due to heap corruption with btnx
2012-01-01 16:58:00 -05:00
Sam Lantinga
028e5dcdbd
Happy New Year!
2011-12-31 09:28:07 -05:00
Sam Lantinga
29177954e7
It works better if you compile it.
2011-11-29 02:28:34 -05:00
Sam Lantinga
f98e88676c
Better fix, iterate backwards over the array so we don't care whether the close code shuffles things down.
2011-11-29 02:27:34 -05:00
Sam Lantinga
22e0d6fa53
Closing the joystick removes it from the list.
2011-11-29 02:15:39 -05:00
Sam Lantinga
10823d6065
Invalid assert. It's perfectly legit to initialize the joystick subsystem and get no joysticks.
2011-11-29 02:12:24 -05:00
Ryan C. Gordon
33981bc8ba
Patched to compile.
2011-09-01 14:02:12 -04:00
Ryan C. Gordon
af022f47ed
Removed unused variable.
2011-09-01 04:34:05 -04:00
Ryan C. Gordon
6b4a7b19a4
Clean up any opened joysticks during SDL_JoystickQuit().
...
Otherwise, these leak memory and maybe operating system handles.
2011-09-01 04:25:15 -04:00
Sam Lantinga
b0660ba5ff
SDL 1.3 is now under the zlib license.
2011-04-08 13:03:26 -07:00
Sam Lantinga
e5803d148c
Happy 2011! :)
2011-02-11 22:37:15 -08:00
Sam Lantinga
c3daf0f0cd
Removed completely non-portable event thread hack.
...
Next I'll be working on generalizing the event sources and making the event queue lock-free. :)
2011-01-27 22:44:08 -08:00
Sam Lantinga
1fb2a69487
General improvements for user custom event registration
...
* Switched event type to enum (int32)
* Switched polling by mask to polling by type range
* Added SDL_RegisterEvents() to allow dynamic user event registration
* Spread events out to allow inserting new related events without breaking binary compatibility
* Added padding to event structures so they're the same size regardless of 32-bit compiler structure packing settings
* Split SDL_HasEvent() to SDL_HasEvent() for a single event and SDL_HasEvents() for a range of events
* Added SDL_GetEventState() as a shortcut for SDL_EventState(X, SDL_QUERY)
* Added SDL_FlushEvent() and SDL_FlushEvents() to clear events from the event queue
2010-03-25 01:08:26 -07:00
Sam Lantinga
4d3df8b3e3
Fixed bug #926
...
Updated copyright to LGPL version 2.1 and year 2010
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404453
2010-01-24 21:10:53 +00:00
Ryan C. Gordon
516aaa5d6c
Merged r3787:3788 from branches/SDL-1.2: better failures for joystick opening.
...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404358
2010-01-06 06:40:16 +00:00
Sam Lantinga
5575687744
Debian patch: 218_joystick_memmove.diff
...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404032
2009-10-10 10:02:17 +00:00
Sam Lantinga
0c30a927ed
Updated copyright date
...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403321
2008-12-08 00:27:32 +00:00
Sam Lantinga
4fd9c25fe6
Final merge of Google Summer of Code 2008 work...
...
Force Feedback for SDL
by Edgar Simo, mentored by Ryan C. Gordon
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403159
2008-08-25 09:55:03 +00:00
Sam Lantinga
0f030a1802
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401938
2006-07-10 21:04:37 +00:00
Sam Lantinga
26cb9c7c80
Fixed some ultra-pedantic gcc warnings
...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401619
2006-03-24 06:10:24 +00:00
Sam Lantinga
c36118165e
Use consistent identifiers for the various platforms we support.
...
Make sure every source file includes SDL_config.h, so the proper system
headers are chosen.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401406
2006-02-21 08:46:50 +00:00
Sam Lantinga
1da8cb0143
Use only safe string functions
...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401383
2006-02-19 23:46:34 +00:00
Sam Lantinga
d3805eef09
New configure-based build system. Still work in progress, but much improved
...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401365
2006-02-16 10:11:48 +00:00
Sam Lantinga
684909fae2
More header massaging... works great on Windows. ;-)
...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401362
2006-02-10 06:48:43 +00:00
Sam Lantinga
09cd73f1b5
Removed uses of stdlib.h and string.h
...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401342
2006-02-07 09:29:18 +00:00
Sam Lantinga
5d53175e4d
Use SDL_ prefixed versions of C library functions.
...
FIXME:
Change #include <stdlib.h> to #include "SDL_stdlib.h"
Change #include <string.h> to #include "SDL_string.h"
Make sure nothing else broke because of this...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401340
2006-02-07 06:59:48 +00:00
Sam Lantinga
6c3f928cd8
It's now possible to build SDL without any C runtime at all on Windows,
...
using Visual C++ 2005
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401334
2006-02-06 08:28:51 +00:00
Sam Lantinga
eea4857268
Updated copyright information and removed rcs id lines (problematic in branch merges)
...
I batch edited these files, so please let me know if I've accidentally removed anybody's
credit here.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401315
2006-02-01 06:32:25 +00:00
Sam Lantinga
cb9c2efd17
Updated copyright information for 2004 (Happy New Year!)
...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40770
2004-01-04 16:49:27 +00:00
Ryan C. Gordon
f41ebcb461
SDL_JoystickInit: If malloc() fails, pretend no joysticks were detected.
...
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40717
2003-09-13 02:20:32 +00:00