Ryan C. Gordon
28a15d3609
Replace all the "static __inline__" functions with SDL_FORCE_INLINE.
2013-03-15 01:09:19 -04:00
Ryan C. Gordon
1fa34e72be
Improvements to stdlib.
...
All SDL_* functions are always available as real symbols, so you can always
link against them as a stable ABI. By default, however, all the things that
might have dithered down to macros in your application are now force-inlined,
to give you the same effect as before and theoretically better performance,
but still solve the classic macro problems.
Elsewhere, we provide real functions for these things that simply wrap the
inline functions, in case one needs to have a real function available.
Also: this exposed bugs: SDL_abs() does something different if you had the
macro vs the libc function, SDL_memcpy() returns a void* in the function
but not the macro, etc.
2013-03-15 01:01:20 -04:00
Ryan C. Gordon
fae7c9cf7d
Added an SDL_FORCE_INLINE macro.
2013-03-15 01:02:30 -04:00
Andreas Schiffler
157d9c6b00
Fix bug 122 - SDL_RWops bug fixes: set RWops.type field, add input validation, add test coverage
2013-03-13 08:35:03 -07:00
Andreas Schiffler
c6e3903e5b
Fix bug 1560 - SDL_RWFromConstMem write operation returns -1 but should return 0.
2013-03-12 09:10:37 -07:00
Ryan C. Gordon
e097576967
First shot at Windows XInput haptics.
2013-03-10 13:05:47 -04:00
Andreas Schiffler
449a8da224
Add parameter checking to SetWindowSize functions; add tests to video suite
2013-03-08 23:33:07 -08:00
Sam Lantinga
b6d332f3ab
Updated SDL_HINT_GAMECONTROLLERCONFIG documentation to reflect that it only takes effect before init.
2013-03-08 16:27:05 -08:00
Ryan C. Gordon
ec1318bf1a
Changed SDL_INIT_EVERYTHING to only request currently-known subsystems.
2013-03-08 11:38:08 -05:00
Sam Lantinga
8c502e53f0
Don't re-read the hints when opening the game controller. Instead use SDL_GameControllerAddMapping() to add hints after initialization.
2013-03-08 10:09:51 -08:00
Sam Lantinga
e4ff0d5a17
Put the real SDL_AtomicCAS() and SDL_AtomicCASPtr() symbols into the library.
2013-03-07 20:42:55 -08:00
Sam Lantinga
2952d9bf48
Changed the name of SDL_mutexP() SDL_mutexV()
2013-03-07 20:12:40 -08:00
Sam Lantinga
e04e170169
The joystick events contain a joystick instance ID, which is a signed value, with -1 being invalid.
2013-03-06 11:59:21 -08:00
Sam Lantinga
74137ce784
Removed multi-input events, since we removed the unimplemented API recently.
2013-03-06 11:59:15 -08:00
Edward Rudd
e4d41effe3
Add SDL_TryLockMutex and implementations for all platforms
2013-03-05 18:54:55 -05:00
Edward Rudd
f6e2a00b15
add hint to allow disabling the use of Xinput.
2013-03-05 18:01:59 -05:00
Edward Rudd
3e7df38c71
add new gamecontroller APIs
...
- add mappings after init (or even before w/o using the hint)
- get string for axis
- get string for button
- get mapping string for controller or for GUID
- new event to notify when a controller is remapped. (e.g. mapping was changed via the AddMapping method)
2013-03-05 17:59:36 -05:00
Sam Lantinga
1916ec2de3
Updated touch API
...
* Normalized touch coordinates as floats in the 0...1 range
* Removed unused touchpad concepts from the API
* Added API functions to get active touch devices and current finger state
2013-03-03 01:01:33 -08:00
Sam Lantinga
a2aa3983b3
Added a mouse ID to the mouse events, which set to the special value SDL_TOUCH_MOUSEID for mouse events simulated by touch input.
2013-03-02 20:44:16 -08:00
Sam Lantinga
db3cba4095
Fixed the joystick id usage in the joystick and game controller events.
2013-03-02 17:51:32 -08:00
Sam Lantinga
834cbe125f
Updated the link to the USB usage page document
2013-02-28 20:01:17 -08:00
Sam Lantinga
f0bf08280b
Fixed gcc pedantic warnings in public headers
2013-02-26 20:41:28 -08:00
Jørgen P. Tjernø
a387ff7086
sdl2
...
- fix atomic header to compile happily under msvc 6.0
2013-02-25 16:52:48 -08:00
Jørgen P. Tjernø
e2b192f98d
sdl2
...
- change the windows scancode logic to use the scan code value in lparam rather than VK's to get a stable scancode value across different KB layouts
2013-02-25 16:52:42 -08:00
Ryan C. Gordon
3104ca4190
Added SDL_GameControllerUpdate().
2013-02-25 01:51:21 -05:00
Ryan C. Gordon
ad75661c46
Added SDL_haptic.h to SDL.h.
2013-02-25 01:50:59 -05:00
Ryan C. Gordon
b7b7f889c5
Changed the game controller enum types to match SDL naming conventions.
2013-02-25 00:56:21 -05:00
Sam Lantinga
d486363049
The input API was never implemented, so removing it before release.
2013-02-19 05:39:19 -08:00
Sam Lantinga
019c60c1e8
Happy New Year!
2013-02-15 08:47:44 -08:00
Sam Lantinga
2cfcf17348
Updated documentation with info about the wiki
...
We're no longer under construction, baby!
2013-02-14 15:56:33 -08:00
Andreas Schiffler
857ddffc40
Add tests to SDLtest suite
2013-02-13 23:10:29 -08:00
Jørgen P. Tjernø
75626eac76
New SDL_MSBIndex, updated VS projects, cleanup gamecontroller.
...
- Updated Visual Studio 2010 project with SDL 2.0 library names
- Don't use a 256 byte LUT, but rather <32 bytes of data on the stack.
- Cleanups in SDL_gamecontroller.h
2013-02-13 17:19:21 -08:00
Andreas Schiffler
37203106e0
Fix fuzzer random boundary functions; add tests for fuzzer
2013-02-12 22:23:42 -08:00
Jørgen P. Tjernø
29f980d205
Check bounds in SDL_IsGameController. Switch two functions to SDL_bool.
...
Switches SDL_GameControllerGetAttached and SDL_IsGameController to
return SDL_bool, instead of int.
2013-02-12 17:07:21 -08:00
Jørgen P. Tjernø
e8a48ee6c0
Don't clobber refcounting in SDL_Init.
...
- Fixes bug 1712 by not overwriting SDL_SubsystemRefCount in SDL_Init.
- Removes the SDL_initialized variable, and makes SDL_SubsystemRefCount
the canonical source of truth for whether or not a subsystem has been
initialized.
- Refactors SDL_InitSubSystem and SDL_QuitSubSystem to use helper
functions to manage refcount.
- Adds automated tests for SDL_Init/Quit*.
- Adds SDL_bits.h which contains SDL_MostSignificantBitIndex.
2013-02-12 11:47:31 -08:00
Sam Lantinga
b2bcc76cd9
Fixed building SDL under Xcode
2013-02-11 11:09:55 -08:00
Sam Lantinga
e070132e57
Fixed typo in documentation
2013-01-27 15:53:24 -08:00
Tim Angus
0057af3d90
Fix warning in SDL_keyboard.h
2013-01-17 11:54:14 +00:00
Andreas Schiffler
0720db59b2
Update SDL_InvalidParamError to take param name; add additional fuzzer function; add new tests to keyboard test suite; improve surface test suite
2013-01-12 22:58:12 -08:00
Andreas Schiffler
298c11033b
Add new internal error message for invalid parameters; add validation of input rect in SDL_SetTextInputRect; add test cases for SDL_SetTextInputRect to keyboard suite
2013-01-11 20:36:39 -08:00
Gabriel Jacobo
f997d045c5
Android: Access APK files using AssetFileDescriptor
2013-01-08 09:30:53 -03:00
Sam Lantinga
30cf30ad23
Fixed bug 1653 - comma at the end of enum
...
Martin Gerhardy 2012-11-30 03:07:14 PST
SDL_gamecontroller.h:61:29: warning: comma at end of enumerator list [-pedantic]
2012-12-31 16:29:01 -08:00
Sam Lantinga
06f8fe85cf
Added SDL_SetWindowMaximumSize() and SDL_GetWindowMaximumSize()
...
Also fixed Cocoa implementation so that it affects client area, not the whole window area.
2012-12-31 12:15:25 -08:00
Sam Lantinga
ad65f9e5a4
Added SDL_GetDisplayName(), with implementation for Mac OS X
2012-12-31 11:07:46 -08:00
Sam Lantinga
c856925d3e
Renamed SDL_GetWindowDisplay() to SDL_GetWindowDisplayIndex()
2012-12-31 10:29:17 -08:00
Sam Lantinga
f425fe1358
Improvements from Alfred:
...
- Added new SDL_HINT_ALLOW_TOPMOST hint, when set to "0" then never set the topmost bit on a window. Useful when debugging fullscreen issues.
- fixed crash in windows joystick scanning if we failed to load the xinput dll
- added support for SDL_WINDOW_FULLSCREEN_DESKTOP under windows
- synthesize relative mouse movements if directinput fails to send relative moves, happens under virtual box.
2012-12-31 09:30:15 -08:00
Ryan C. Gordon
2d97db998b
Better compiler warning fix for gcc2.
2012-12-28 20:01:41 -05:00
Ryan C. Gordon
a2d1bcb337
Fixing buildbot on Haiku.
...
Damn you, gcc2.
2012-12-28 18:15:02 -05:00
Ryan C. Gordon
b71c7f092b
Replaced Gnome screensaver hack with D-Bus messages to org.gnome.ScreenSaver.
2012-12-28 03:46:55 -05:00
Andreas Schiffler
e00532130b
Add surface test suite; minor improvements to render suite; refactor image saving into test lib compare function; fix for Haiku build
2012-12-26 22:26:44 -08:00
Andreas Schiffler
669e4e9a21
Added audio test suite; minor code cleanups in test lib
2012-12-24 14:43:57 -08:00
Sam Lantinga
cc09717698
Fixed const correctness in the test harness
2012-12-22 17:24:14 -08:00
Sam Lantinga
2269018714
Merged Andreas' changes
2012-12-22 16:52:00 -08:00
Andreas Schiffler
add645da12
Test lib updates: updated harness to support filtering, added surface comparer, updated interface to test images; added Render test suite from GSOC project
2012-12-22 16:06:55 -08:00
Sam Lantinga
6265362318
The latest version of MinGW-w64 has the necessary headers and libraries: http://mingw-w64.sourceforge.net/
2012-12-22 11:23:18 -08:00
Andreas Schiffler
ead556e41f
Add image data definitions (for render tests) to test lib
2012-12-20 08:50:36 -08:00
Ryan C. Gordon
7007dc6ac2
Patched to compile when SDL_ASSERT_LEVEL is zero.
2012-12-18 06:35:49 -05:00
Andreas Schiffler
f9c94c75e8
Refactor/fix test lib harness, assert and log component; add harness driver; port platform suite from GSOC code
2012-12-14 23:05:34 -08:00
Sam Lantinga
26cf48ded8
Improvements from Alfred:
...
- Add new SDL_WINDOW_FULLSCREEN_DESKTOP video mode, makes a fullscreen window the size of the desktop (i.e no window manager mode change)
- Fix crash in warp mouse if you specified null as the window
- Added new SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS Hint, if set to 0 then don't minimize a fullscreen window on focus lost (if not set or set to non-zero then minimize on focus loss)
2012-12-15 00:30:17 +00:00
Ryan C. Gordon
ed4988c379
Fixed comment on SDL_JoystickGetGUIDString().
2012-12-11 16:53:38 -05:00
Sam Lantinga
eee39a0603
Don't build with X11 by default since it's not included with the latest versions of Mac OS X. Cocoa is the preferred path here.
2012-12-11 12:03:00 -08:00
Sam Lantinga
10abca2c02
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
Ryan C. Gordon
211e1cb7ec
Updated Linux joystick code to support hotplug, GUIDs, etc.
...
This uses libudev for hotplug, but it's optional, so we'll just try to find
some reasonable defaults without it (maybe an older Linux box or under
FreeBSD's Linux emulation?).
2012-12-11 12:07:06 -05:00
Andreas Schiffler
e1c75c0fc9
Added existing common.c/.h functions to test lib; minor assert refactoring
2012-12-09 17:56:19 -08:00
Andreas Schiffler
e96fd5ab17
Added to harness in test lib (work in progress)
2012-12-04 19:21:10 -08:00
Andreas Schiffler
ca03267939
Update assert API in test lib; add to and harness; add test lib to VS2010 and VS2012 solution; fix VS2012 solution; fix compiler warning
2012-12-01 14:48:30 -08:00
Andreas Schiffler
7c313311a4
Add log, assert and harness (partial) to test lib
2012-11-30 23:25:34 -08:00
Andreas Schiffler
8515d11219
Add crc32 and md5 to test lib
2012-11-28 19:19:57 -08:00
Andreas Schiffler
2cfb6fbb8e
Add fuzzer to test lib
2012-11-27 21:40:46 -08:00
Sam Lantinga
3f5fd55965
Organized joystick hotplug code a bit.
...
Cleaned up names, return types, etc.
2012-11-27 00:58:12 -08:00
Andreas Schiffler
8ee87a4da7
Add random module to test lib
2012-11-26 23:12:47 -08:00
Sam Lantinga
23950f0183
Added hotplug joystick support and simplified game controller API, courtesy of Alfred Reynolds
2012-11-26 16:37:54 -08:00
Sam Lantinga
9c2cdf677b
Work in progress on an SDL test library
2012-11-26 07:53:56 -08:00
Sam Lantinga
d4219579f2
Fixed clang -Weverything warnings
2012-11-22 11:55:11 -08:00
stopiccot
0bb179ae8a
SetMinimumWindowSize for OS X
2012-11-18 15:45:12 +03:00
Ryan C. Gordon
b8d7fecdf7
Removed some tab chars.
2012-11-21 23:00:06 -05:00
Ryan C. Gordon
4380a1eacf
Removed commas at the end of enums, to make gcc's -pedantic happy.
...
Fixes Bugzilla #1647 .
2012-11-21 22:59:42 -05:00
Sam Lantinga
ee5bc4e7ab
Added code to testwm2 to test the system cursor support
2012-11-19 20:38:52 -08:00
Michael Sartain
f4161f1ea6
Add SDL_CreateSystemCursor for Windows and Linux.
2012-11-19 15:11:10 -08:00
Gabriel Jacobo
1995df04e8
Adds CMake build system by Marcus Von Appen (bug #1597 )
2012-11-16 09:23:18 -03:00
Sam Lantinga
105e4c7072
Nobody will EVER use more than 8 buttons. Oh wait... Nobody will EVER use more than 32 buttons...
2012-11-12 12:14:44 -08:00
Sam Lantinga
d3d6706dfc
SDL no longer grabs the keyboard by default on X11.
...
You can re-enable that functionality by setting a new hint SDL_HINT_GRAB_KEYBOARD
2012-11-07 15:55:43 -08:00
Sam Lantinga
4ff7b0238c
Added SDL_ReadU8() and SDL_WriteU8() for consistency with the rest of the API.
2012-11-04 23:44:13 -08:00
Sam Lantinga
9e89faaf15
Synchronized the on-screen keyboard state with whether we are accepting text input.
...
The functions to show/hide/toggle the on-screen keyboard have been folded into the text input state.
Calling SDL_StartTextInput() will automatically show the on-screen keyboard if it's available.
Calling SDL_StopTextInput() will automatically hide the on-screen keyboard if it's available.
There is a new API function SDL_IsTextInputActive() which will return whether text input is currently active.
Text input is disabled by default, you must call SDL_StartTextInput() when you are ready to accept text input.
SDL_HasScreenKeyboardSupport() no longer needs to be passed a window.
The iPhone-specific on-screen keyboard functions have been removed.
2012-11-04 21:53:28 -08:00
Sam Lantinga
2a972eadfe
Added documentation on loading assets on Android.
2012-11-04 09:45:18 -08:00
Sam Lantinga
e7ea5f6646
Added an API to get the size of a file - WARNING! ABI CHANGE!
2012-11-03 18:43:36 -07:00
Ryan C. Gordon
6c4223b251
More compiler warning fixes.
2012-11-02 14:03:14 -04:00
Ryan C. Gordon
28fbd54ae5
Fixed compiler warnings about "/*" inside a multi-line comment.
2012-11-02 14:00:44 -04:00
Sam Lantinga
525b3ca0e9
Added some platform specific API functions for Android:
...
SDL_AndroidGetJNIEnv()
SDL_AndroidGetActivity()
SDL_AndroidGetInternalStoragePath()
SDL_AndroidGetExternalStorageState()
SDL_AndroidGetExternalStoragePath()
2012-11-02 02:22:32 -07:00
Sam Lantinga
017bece619
We might actually have PI
2012-11-01 00:12:57 -07:00
Sam Lantinga
4bbe3a7073
Added an assert log category, and NSLog support on Mac OS X and iOS
2012-10-30 12:30:02 -07:00
Sam Lantinga
07f0419650
Added some documentation on the behavior of SDL_ShowMessageBox()
2012-10-30 10:07:32 -07:00
Sam Lantinga
35feaaaf51
It turns out that UCS2 and UCS4 are defined as big-endian encodings
2012-10-28 13:03:45 -07:00
Sam Lantinga
82f91da2d0
Added API for simple messagebox, courtesy of Mike Sartain
2012-10-23 17:11:22 -07:00
Sam Lantinga
93902fa034
Updated the copyright date on the default config file
2012-10-23 15:59:07 -07:00
Sam Lantinga
73c7d679a0
Switch C++ comment to C comment
2012-10-21 22:18:36 -07:00
Sam Lantinga
49796bf2b6
Fixed another gcc <-> Visual C++ ABI issue
2012-10-20 00:49:08 -07:00
Sam Lantinga
9090fb9b4c
Make it possible to build a DLL with mingw that's ABI compatible with Visual C++ built applications
2012-10-20 00:14:58 -07:00
Sam Lantinga
9a6b1c641a
Added SDL_GetRenderTarget() API function
...
Also fixed a bug with setting logical size for a render target.
2012-10-12 02:20:10 -07:00
Sam Lantinga
a1f39a5854
I'm becoming more and more convinced that the application should never use XRandR, and it's the window manager's responsibility to track and manage display modes for fullscreen windows.
...
Because it's so broken, I'm going to disable XRandR by default. You can still enable it via environment variable or application hint (SDL_HINT_VIDEO_X11_XRANDR)
2012-10-04 13:50:41 -07:00