Commit Graph

1221 Commits

Author SHA1 Message Date
Alex Szpakowski
f871c178b9 macOS: remove dead code for supporting 10.6 at runtime. 2022-05-10 14:04:14 -07:00
Simon McVittie
8ab3ae98f0 stdinc: Add a comment to clarify why inline functions are needed here
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-10 06:50:54 -07:00
Alex Szpakowski
d35c737f1c macOS: change min supported OS from 10.6 to 10.7. 2022-05-09 21:53:40 -07:00
Simon McVittie
f661654fad stdinc: Add overflow-checking add and multiply for size_t
This can be used to check whether untrusted sizes would cause overflow
when used to calculate how much memory is needed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-09 21:31:39 -07:00
Simon McVittie
cd7c2f1de7 Switch versioning scheme to be the same as GLib and Flatpak
For stable releases, this gives us the ability to make bugfix-only point
releases such as 2.24.1 if we want to, and distinguish between them
programmatically. For example, this ability could have been useful after
2.0.16 to fix Xwayland regressions, and after 2.0.18 to fix event loop
regressions.

For development releases, this gives us the ability to make multiple
prereleases during the same feature cycle, and distinguish between them
programmatically. For example, this would have been useful during 2.0.22
development, which went through three prereleases before reaching the
final release.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 09:55:35 -07:00
Simon McVittie
ba6f96275e Document SDL_VERSIONNUM as able to encode larger minor versions
Now that we've said this will be removed from SDL 3, we're free to use
any encoding that is compatible with existing SDL versions and will still
compare correctly for all SDL 2 version numbers. This allows the SDL 2
minor version to go beyond 1 digit, limited only by the size of
SDL_version.minor (which is 8 bits), making the largest possible version
number 2.255.99.

The patchlevel (micro version) is still limited to 2 digits.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 09:55:35 -07:00
Simon McVittie
e0daa2a530 Deprecate SDL_COMPILEDVERSION and SDL_VERSIONNUM, to be removed in 3.x
The encoding used in SDL_VERSIONNUM (e.g. 2.0.22 -> 2022) cannot
represent 2-digit minor versions without overflowing from the hundreds
digit into the thousands digit, which produces confusing version
numbers that will compare incorrectly when the major version is increased
to 3.

However, we can sidestep this problem by declaring that SDL_VERSIONNUM
will no longer be present in SDL 3, which means it only needs to be able
to represent SDL 2 version numbers losslessly.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 09:55:35 -07:00
Simon McVittie
f9a5cf77b8 Make SDL_VERSION_ATLEAST future-proof against larger version numbers
This comparison normally happens at compile-time, not at runtime, so
it doesn't matter if it isn't optimal. This avoids incorrect comparison
if the minor version in SDL_COMPILEDVERSION and SDL_VERSIONNUM has more
than one digit, which would cause it to overflow from the hundreds place
into the thousands place.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-04 09:55:35 -07:00
Cameron Cawley
b398a847be Add SDL_FLOATWORDORDER for older ARM toolchains 2022-05-04 09:52:11 -07:00
atfrase
db9e14e504 disabled linux joystick debugging outputs and reverted unnecessary comment edit 2022-05-03 10:44:09 -07:00
atfrase
3696e23d09 added hints SDL_HINT_LINUX_DIGITAL_HATS and SDL_HINT_LINUX_HAT_DEADZONES to control the new Linux hat handling; added define DEBUG_GAMEPAD_MAPPINGS to log messages when generating default gamepad mapings for Linux joysticks 2022-05-03 10:44:09 -07:00
Michael Fitzmayer
fbd230bb6c
Add support for the Nokia N-Gage (#5597)
* Add initial support for the Nokia N-Gage

* N-Gage: disable clipping for the time being, issue needs to be resolved later

* Move va_copy definition to SDL_internal.h

* Move stdlib.h include to SDL_config_ngage.h, much cleaner this way

* Remove redundant include, add HAVE_STDLIB_H

* Revert "N-Gage: disable clipping for the time being, issue needs to be resolved later"

This reverts commit 4f5f0fc36cc7f34fad05e45671dfa7b8dc32fd51.

* N-Gage: fix clipping issue by providing proper math functions
2022-05-03 08:51:49 -07:00
Susko3
6150245d65 Add new verbosity level for logging of SDL_SysWMEvents
Now logged only if SDL_HINT_EVENT_LOGGING is set to "3" or above.
2022-05-02 15:33:13 -07:00
Sam Lantinga
829f6b3d7d These headers are system headers, not local headers 2022-04-30 11:33:03 -07:00
Sam Lantinga
f81419702e Document that SDL_MAX_LOG_MESSAGE is no longer meaningful 2022-04-29 11:28:59 -07:00
Ryan C. Gordon
7d7ec9c951
x11: Remove XVidMode and Xinerama support.
Fixes #1782.
2022-04-26 23:17:13 -04:00
Sam Lantinga
e551384a99 Added functions to get the platform dependent name for a joystick or game controller 2022-04-26 14:54:14 -07:00
Ozkan Sezer
e9ff4fdd49 add SDL_bsearch 2022-04-26 04:03:25 +03:00
meyraud705
3dcfe86082 Add joystick battery event 2022-04-25 15:46:17 -07:00
Sam Lantinga
fa29e2d7f7 Updated to version 2.0.23 for development 2022-04-25 13:45:51 -07:00
Eddy Jansson
0288de8529 SDL_Rect: Add \sa documentation block to SDL_FRect 2022-04-22 12:09:13 -04:00
Eddy Jansson
fc944859d1 SDL_Rect: Use a default epsilon in SDL_FRectEquals()
Add SDL_FRectEqualsEpsilon() for when more control over
equality test is required.
2022-04-20 08:38:53 -07:00
Eddy Jansson
00feca27b0 Add SDL_FLT_EPSILON. 2022-04-20 08:38:53 -07:00
Ethan Lee
c37090f9a4 wayland: Add support for TOOLTIP/POPUP_MENU 2022-04-18 12:31:02 -04:00
Ryan C. Gordon
c1336b21ed hints: Make SDL_VIDEODRIVER and SDL_AUDIODRIVER formal hints.
They were just environment variables before.

Fixes #5528.
2022-04-17 11:31:55 -07:00
David Gow
9c2f46b0d5 Wayland: Add SDL_HINT_VIDEO_WAYLAND_PREFER_LIBDECOR
This hint allows libdecor to be used even when xdg-decoration is
available. It's mostly useful for debugging libdecor, but could in
theory be used by applications which want to (for example) bundle their
own libdecor plugins.
2022-04-12 11:52:41 -04:00
Sam Lantinga
505d6a4a05 Update version to 2.0.22 for release 2022-04-08 18:18:56 -07:00
Sam Lantinga
6d7d142b70 Fixed typo 2022-04-08 18:10:38 -07:00
Connor Clark
6dbca7c911 Compile with recursive mutexes for emscripten
Emscripten actually does support recursive mutexes, so no need to use SDL's fake recursive code.

Background: #5428, #5479
2022-04-06 18:51:35 -07:00
Ozkan Sezer
c0bb39e5e9 check for HAVE_ROAPI_H in cmake and autotools, and
update SDL_config_windows.h and SDL_config_winrt.h
2022-04-02 02:50:02 +03:00
Jaylon Gowie
8c542a3591 Desktop OpenGL 1.X/2.X PSVita Support 2022-03-31 00:02:56 -04:00
Ryan C. Gordon
3425e9950e
stdinc: SDL_COMPILE_TIME_ASSERT defines shouldn't have a semicolon. 2022-03-30 10:13:47 -04:00
Ivan Epifanov
96be9cddcc Vita: add hint to select which touchpad generates mouse events 2022-03-28 08:36:32 -07:00
Cameron Gutman
a60986caa8 Correct default structure packing on Windows ARM64
See issue #5454 for details
2022-03-27 19:03:54 -05:00
SDL Wiki Bot
6d1c3cd691 Sync wiki -> header 2022-03-27 17:11:05 +00:00
SDL Wiki Bot
2591f7e39c Sync wiki -> header 2022-03-27 16:52:04 +00:00
SDL Wiki Bot
7ba4d24c25 Sync wiki -> header 2022-03-27 16:49:05 +00:00
Ryan C. Gordon
7bc498d325
direct3d: Implement missing blend operations.
This is only for Direct3D 9; Direct3D 11 already had this implemented.

Fixes #5375.
2022-03-27 09:14:07 -04:00
SDL Wiki Bot
2a4e0f8fd0 Sync wiki -> header 2022-03-23 16:09:05 +00:00
Sylvain Becker
c23a7ad38a
Add SDL_RenderGetWindow() API to get the window associated with a renderer (#5440)
Add SDL_RenderGetWindow() API to get the window associated with a renderer
2022-03-23 17:07:56 +01:00
Ryan C. Gordon
f782abe5f0
hints: Added SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE.
Fixes #2349.
2022-03-22 09:54:29 -04:00
Ryan C. Gordon
2b3c16eb5b
Sync wiki -> headers. 2022-03-20 23:17:14 -04:00
Ryan C. Gordon
d81fee7623
SDL_Rect: Added floating point versions of all the rectangle APIs.
Fixes #5110.
2022-03-19 10:35:24 -04:00
SDL Wiki Bot
aef1e56737 Sync wiki -> header 2022-03-18 17:30:05 +00:00
Sam Lantinga
40b7326b38 Added a note that SDL_RenderReadPixels() should be called before SDL_RenderPresent() 2022-03-18 10:28:38 -07:00
Sam Lantinga
6c96217727 Added the hint SDL_HINT_MOUSE_RELATIVE_MODE_CENTER, controlling whether the mouse should be constrained to the center of the window or the whole window in relative mode.
For further info about the pros and cons, check out the discussion in https://github.com/libsdl-org/SDL/issues/5271
2022-03-18 10:07:59 -07:00
Sam Lantinga
5ff42438e3 Added a hint to capture the mouse when mouse buttons are pressed, defaulting on
Fixes https://github.com/libsdl-org/SDL/issues/5301
2022-03-17 17:39:46 -07:00
Sam Lantinga
e5f45455c9 Added a hint to mark a foreign window as usable with OpenGL
Fixes https://github.com/libsdl-org/SDL/issues/2942
2022-03-17 14:44:34 -07:00
Ethan Lee
0bf8ccfb60 video: Add a hint to allow Vulkan surfaces on foreign windows 2022-03-17 14:25:55 -07:00
Ozkan Sezer
f0d2747df1 use _Static_assert for SDL_COMPILE_TIME_ASSERT(), when available 2022-03-17 08:43:27 -07:00