|
35c1bbfa
|
2021-08-13T21:43:00
|
|
SDL_stdinc.h: Add an SDL_clamp() function
Add a function to clamp a value to a range.
SDL_clamp(x, a, b) is equivalent to SDL_min(a, SDL_max(x, b)): it
ensures that x is not smaller than a, nor larger than b.
While, as best I can tell, this isn't actually standardised anywhere,
it's a very useful function/macro to have.
|
|
9bf65575
|
2021-08-13T06:36:49
|
|
Correctly check for bswap builtins before using
The __clang_major__ and __clang_minor__ macros provide a marketing
version, which is not necessarily comparable for clang distributions
from different vendors[1]. In practice, the versioning scheme for
Apple's clang is indeed completely different to that of the llvm.org
releases. It is thus preferable to check for features directly rather
than comparing versions.
In this specific case, __builtin_bswap16 was being used with older
Apple clang versions that don't support it.
[1] https://clang.llvm.org/docs/LanguageExtensions.html#builtin-macros
|
|
d5ad6f6e
|
2021-08-10T16:51:03
|
|
Clarified that you should never have side-effects in the parameters to SDL_min/SDL_max
|
|
c88eb7a8
|
2021-07-14T17:07:04
|
|
Sync wiki -> header.
|
|
25fc40b0
|
2021-06-10T13:56:22
|
|
stdinc: Silence clang warning for -Wimplicit-fallthrough.
In a more ideal world, we'd use the appropriate `__attribute__` here, but
it's one thing in a public header that probably shouldn't be there at all, so
this is good enough for now.
Fixes #4307.
|
|
ca5e5d61
|
2020-12-18T16:34:24
|
|
VITASDK compatibility
|
|
a2fbc452
|
2021-02-15T03:02:32
|
|
replace i386 checks with __i386__
|
|
dfe219ec
|
2021-02-13T11:21:19
|
|
Add all missing "is characteristic" stdlib functions
SDL has been missing a bunch of these 'isX' functions for some time,
where X is some characteristic of a given character.
This commit adds the rest of them to the SDL stdlib, so now we have:
- SDL_isalpha()
- SDL_isalnum()
- SDL_isblank()
- SDL_iscntrl()
- SDL_isxdigit()
- SDL_ispunct()
- SDL_isprint()
- SDL_isgraph()
|
|
f443a6fc
|
2021-02-11T02:05:02
|
|
Fix format string warnings for width-based integers
The DJGPP compiler emits many warnings for conflicts between print
format specifiers and argument types. To fix the warnings, I added
`SDL_PRIx32` macros for use with `Sint32` and `Uint32` types. The macros
alias those found in <inttypes.h> or fallback to a reasonable default.
As an alternative, print arguments could be cast to plain old integers.
I opted slightly for the current solution as it felt more technically correct,
despite making the format strings more verbose.
|
|
9130f7c3
|
2021-01-02T10:25:38
|
|
Updated copyright for 2021
|
|
93ccdee8
|
2020-12-23T13:47:49
|
|
Fixed bug 5404 - stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf
Cameron Cawley
stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf
The default implementation is based on the one used in the Windows RT video driver.
|
|
bca9decb
|
2020-12-12T23:28:10
|
|
fix bug #5394 - define _DARWIN_C_SOURCE only if not already defined
|
|
46a84478
|
2020-11-24T12:43:01
|
|
Added SDL_wcscasecmp() and SDL_wcsncasecmp()
|
|
71e32f5e
|
2020-11-16T15:00:15
|
|
Added SDL_crc32()
|
|
79221e85
|
2020-10-29T20:00:20
|
|
SDL_stdinc.h: define _DARWIN_C_SOURCE on macOS for memset_pattern4()
hopefully fixes https://bugzilla.libsdl.org/show_bug.cgi?id=5107
|
|
6aec6da4
|
2020-06-28T17:45:07
|
|
stdinc: Let Clang static analysis see more C runtime functions.
For systems without strlcpy and strlcat, just declare them as if they exist;
the analyzer possibly still knows the details of these functions and can
utilize that in its analysis.
Most of this patch was from meyraud705 at gmail and Martin Gerhardy. Thanks!
Fixes Bugzilla #5163.
|
|
d292f6bd
|
2020-04-10T12:17:14
|
|
stdlib: Add SDL_trunc and SDL_truncf
|
|
aa384ad0
|
2020-03-02T15:21:07
|
|
Fixed bug 5001 - Feature request: SDL_isupper & SDL_islower
|
|
a8780c6a
|
2020-01-16T20:49:25
|
|
Updated copyright date for 2020
|
|
65096446
|
2019-11-20T16:42:50
|
|
Improved XInput VID/PID detection and added SDL_wcsstr() and SDL_wcsncmp()
|
|
eb8f14bb
|
2019-11-20T20:40:50
|
|
added SDL_strtokr() as a replacement for POSIX strtok_r (bug #4046.)
|
|
f49c07b5
|
2019-09-04T00:39:47
|
|
stdinc: On macOS and iOS, use memset_pattern4() for SDL_memset4().
Fixes Bugzilla #4724.
|
|
7a47c292
|
2019-07-31T01:22:02
|
|
Fix bug 4746 - introduce SDL_zeroa macro.
|
|
5e13087b
|
2019-01-04T22:01:14
|
|
Updated copyright for 2019
|
|
d2042e1e
|
2018-08-09T16:00:17
|
|
Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms.
Added SDL_GameControllerRumble() and SDL_JoystickRumble() for simple force feedback outside of the SDL haptics API
|
|
b4fe7412
|
2018-08-04T11:52:46
|
|
SDL_exp
|
|
c11ae93a
|
2018-05-10T08:28:00
|
|
SDL_stdinc.h: move the alloca() includes before begin_code.h
|
|
4c2a444e
|
2018-02-08T17:07:47
|
|
add SDL_log10 and SDL_log10f to include and dynapi
|
|
e3cc5b2c
|
2018-01-03T10:03:25
|
|
Updated copyright for 2018
|
|
bcdf8b91
|
2017-11-04T17:35:03
|
|
Added SDL_fmod() and SDL_fmodf()
|
|
34502143
|
2017-11-04T15:34:14
|
|
Added float versions of SDL's math functions
|
|
a225ffc1
|
2017-10-16T14:39:56
|
|
Added min/max macros for the sized SDL datatypes
|
|
fc60db86
|
2017-10-12T17:17:09
|
|
Fixed compiler warning
|
|
9c580e14
|
2017-10-12T13:44:28
|
|
Added functions to query and set the SDL memory allocation functions:
SDL_GetMemoryFunctions()
SDL_SetMemoryFunctions()
SDL_GetNumAllocations()
|
|
4ca5d862
|
2017-09-06T04:32:30
|
|
Fixed bug 3780 - GCC 7 implicit fallthrough warnings
Martin Gerhardy 2017-08-28 06:58:01 UTC
SDL_blit.h, SDL_fillrect.c and SDL_stdinc.h produces a lot of the (new) gcc-7 implicit fallthrough warnings.
|
|
f8de064c
|
2017-08-13T22:26:44
|
|
Added wchar.h to fix build on some platforms with new wcs* functions
|
|
f1829d95
|
2017-08-13T20:37:49
|
|
Added SDL_wcscmp()
|
|
43d62b74
|
2017-06-10T15:38:14
|
|
Make compile-time assert error messages more clear.
Now the compiler might say this:
'SDL_compile_time_assert_mytest' declared as an array with a negative size
instead of
'SDL_dummy_mytest' declared as an array with a negative size
|
|
cbcc256f
|
2017-06-04T23:15:39
|
|
Fixed comments in headers for doxygen output.
|
|
d4086e4a
|
2017-05-29T03:01:05
|
|
stdlib: added SDL_utf8strlen().
|
|
ca0bf151
|
2017-03-03T16:38:17
|
|
Fix some more compiler warnings on armcc.
|
|
45b774e3
|
2017-01-01T18:33:28
|
|
Updated copyright for 2017
|
|
36156335
|
2016-11-20T21:34:54
|
|
Renaming of guard header names to quiet -Wreserved-id-macro
Patch contributed by Sylvain
|
|
73f2c541
|
2016-10-07T16:44:42
|
|
Fixed bug 2885 - SDL_stdinc.h doesn't need to include iconv.h
Ryan C. Gordon
We still include iconv.h in SDL_stdinc.h, probably because this header might have referenced the native iconv functions and types directly. Since these are hidden behind a stable ABI now and never just a #define for the system iconv, we shouldn't need this header included from a public SDL header anymore, slowing down external apps compiles and pulling tons of stuff into the namespace.
|
|
b7e45f8a
|
2016-10-01T10:28:00
|
|
Fixed bug 3336 - Failure to build with MinGW-w64
Kai Sterker
There are already patches available from mingw64 that fix the issue
https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-SDL2
With those applied, I could compile SDL2 without problems. But of course, it would be preferable if SDL built cleanly from source.
|
|
42065e78
|
2016-01-02T10:10:34
|
|
Updated copyright to 2016
|
|
0e45984f
|
2015-06-21T17:33:46
|
|
Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
|
|
2c4a6ea0
|
2015-05-26T06:27:46
|
|
Updated the copyright year to 2015
|
|
b72938c8
|
2015-04-20T12:22:44
|
|
Windows: Always set the system timer resolution to 1ms by default.
An existing hint lets apps that don't need the timer resolution changed avoid
this, to save battery, etc, but this fixes several problems in timing, audio
callbacks not firing fast enough, etc.
Fixes Bugzilla #2944.
|
|
fe6c797c
|
2015-04-10T23:30:31
|
|
Fixed an iOS view orientation issue when SDL_GL_CreateContext or SDL_CreateRenderer is called.
|
|
1339ce71
|
2015-04-08T01:42:47
|
|
Make SDL_stdinc.h work when compiling with -Wundef (thanks, Ben!).
Fixes Bugzilla #2664.
|
|
483ea8b7
|
2015-03-02T21:36:45
|
|
Fixed SDL_PRI?64 for 64-bit Linux.
64-bit Linux uses a "long" instead of "long long" for 64-bit ints.
Added a special-case this so SDL_PRI?64 doesn't trigger compiler warnings
when used with SDL's 64-bit datatypes on 64-bit Linux.
|
|
b88ca1b4
|
2015-02-10T16:28:56
|
|
the last parameter of XChangeProperty is the number of elements.. and when the element format is 32.. the element is "long" so we have 5 long elements here.
Yes this seems confusing as on mac+linux Long is either 32 or 64bits depending on the architecture, but this is how the X11 protocol is defined. Thus 5 is the correct value for the nelts here. Not 5 or 10 depending on the architecture.
More info on the confusion https://bugs.freedesktop.org/show_bug.cgi?id=16802
|
|
b48e54aa
|
2015-01-26T22:00:29
|
|
Fixed bug 2802 - [patch] Fix android build compiling in wrong filesystem implementation
Jonas Kulla
The configure script didn't differentiate between Linux and Android, unconditionally compiling in the unix implementation of SDL_sysfilesystem.c.
I'm probably one of the very few people building SDL for android using classic configure + standalone toolchain, so this has gone undetected all along.
|
|
a823982e
|
2015-01-05T01:41:42
|
|
Clang static analysis builds should use C runtime directly.
This is a little macro magic to use malloc() directly instead of SDL_malloc(),
etc, so static analysis tests that know about the C runtime can function
properly, and understand that we are dealing with heap allocations, etc.
This changed our static analysis report from 5 outstanding bugs to 30.
5x as many bugs were hidden by SDL_malloc() not being recognized as malloc()
by the static analyzer!
|
|
623b9d6d
|
2014-12-03T12:47:39
|
|
ugh.. stray character
|
|
06d357fb
|
2014-12-03T12:45:04
|
|
fix SDL_PRIs64 on windows compilers.. (should end in d)
|
|
73daadb7
|
2014-12-03T12:23:17
|
|
switch to use SDL_PRI* macros for long long formatting everywhere.
|
|
70438be2
|
2014-12-03T10:55:23
|
|
WinRT: fixed bug whereby SDL would override an app's default orientation
WinRT apps can set a default, preferred orientation via a .appxmanifest file.
SDL was overriding this on app startup, and making the app use all possible
orientations (landscape and portrait).
Thanks to Eric Wing for the heads up on this!
|
|
9c398852
|
2014-11-22T22:20:40
|
|
Corrected header file documentation comment.
|
|
24c86b55
|
2014-09-11T19:24:42
|
|
[X11] Reconcile logical keyboard state with physical state on FocusIn
since the window system doesn't do it for us like other platforms.
This prevents sticky keys and missed keys when going in and out
of focus, for example Alt would appear to stick if switching away
from an SDL app with Alt-Tab and had to be pressed again.
CR: Sam
|
|
1ea86978
|
2014-08-17T13:11:55
|
|
Removed SDL_round() because the license wasn't compatible with zlib
|
|
4e7db78e
|
2014-08-16T23:23:15
|
|
Added SDL_round(), contributed by Benoit Pierre - thanks!
|
|
3344db40
|
2014-06-23T11:06:50
|
|
Don't redefine standard macros, use SDL specific macros instead to avoid compiler warnings
|
|
ce84813a
|
2014-06-21T11:24:06
|
|
commit 9e211e646f9d51dc1372c9f3c8f47a78caf4f2a5
Author: Sam Clegg <sbc@chromium.org>
Date: Fri Jun 20 12:52:11 2014
Fix win32 build which was failing due to missing PRIs64.
This change adds definitions for the C99 PRIs16 and PRIu64
which are missing from <stdint.h> on at last win32 and
possibly other platforms.
These already existed in testgesture.c so I removed them
from there also.
|
|
0ad1dc18
|
2014-06-08T12:51:02
|
|
Fixed typo in source comment.
|
|
6101e4b2
|
2014-06-07T18:20:01
|
|
Added SDL_sqrtf(), SDL_tan(), SDL_tanf()
|
|
da6d9a9f
|
2014-06-04T10:56:56
|
|
Added annotations to help code analysis tools
CR: Bruce Dawson
|
|
3dcb451f
|
2014-04-09T21:29:19
|
|
Added a README file regarding WinRT support
To note, this file is currently formatted with CRLF line endings, rather than
LF, to allow the file to be viewed with Notepad.
|
|
1367bf87
|
2014-03-09T11:36:47
|
|
Integrated David Ludwig's support for Windows RT
|
|
58edac3e
|
2014-02-02T00:53:27
|
|
Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
|
|
f848adff
|
2013-11-29T10:06:08
|
|
Improve Android pause/resume behavior.
|
|
46740a5a
|
2013-11-28T22:09:21
|
|
WinRT: merged with latest SDL 2.x/HG code
SDL 2.x recently accepted patches to enable OpenGL ES 2 support via Google's ANGLE library. The thought is to try to eventually merge SDL/WinRT's OpenGL code with SDL-official's.
|
|
e7693740
|
2013-11-24T23:35:38
|
|
Added SDL_vsscanf().
|
|
e4146267
|
2013-11-16T18:56:02
|
|
Fixed bug 2245 - add SDL_acos and SDL_asin
Sylvain
Here's some code to add arc cosine, and arc sin functions to SDL_stdlib.c
There are plainly written using SDL_atan.
|
|
2efd4065
|
2013-11-03T09:42:23
|
|
Clarified that SDL_memset4 is a 32-bit assignment and fixed a compiler warning
|
|
69c5d21d
|
2013-10-27T21:26:46
|
|
WinRT: merged with SDL 2.0.1 codebase
|
|
1e78c4a5
|
2013-08-27T12:20:35
|
|
WinRT: more "Windows RT" to "WinRT" renaming
|
|
1e49b1ed
|
2013-08-21T09:47:10
|
|
OCD fixes: Adds a space after /* (glory to regular expressions!)
|
|
695344d1
|
2013-08-21T09:43:09
|
|
OCD fixes: Adds a space before */
|
|
d41fdc94
|
2013-08-13T20:09:52
|
|
WinRT: build fixes and additional WinRT-related integrations with SDL 2.0.0
|
|
f7049b93
|
2013-08-12T22:29:55
|
|
WinRT: merged with SDL 2.0.0 codebase (aka. SDL hg rev d4ce48ff30d1)
|
|
dad42067
|
2013-08-12T11:13:50
|
|
Fixes #2022, do not resume on Android when surfaceChanged
If the app is in landscape mode and the user presses the power button, a pause
is followed immediately by a surfaceChanged event because the lock screen
is shown in portrait mode. This triggers a "false" resume.
So, we just pause and resume following the onWindowFocusChanged events.
Also, wait for SDL_APP_WILLENTERBACKGROUND and SDL_APP_DIDENTERBACKGROUND before
blocking the event pump.
|
|
1ad936eb
|
2013-08-11T19:56:43
|
|
Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow()
Rainer Deyke
I'm running Linux Mint 15 with the Cinnamon window manager. SDL_DestroyWindow consistently locks up for me when the window if fullscreen.
|