Commit Graph

7520 Commits

Author SHA1 Message Date
Jaylon Gowie 48bbe31bc6 Add PreSwapCallback for updating SceCommonDialog 2021-07-21 09:41:10 -07:00
Jaylon Gowie 9c1306bc5e Add elgext.h header 2021-07-21 09:41:10 -07:00
meyraud705 4ada14a267 Replace libc functions to SDL equivalent in wayland video subsystem
Wayland video subsystem uses a mix of libc and SDL function.
This patch switches libc functions to SDL ones and fixes a mismatch in memory
allocation/dealoccation of SDL_Cursor in SDL_waylandmouse.c (calloc on line 201
and SDL_free on line 313) which caused memory corruption if custom memory
allocator where provided to SDL.
2021-07-21 09:28:38 -07:00
Ivan Epifanov f806064e7e Remove 'support' for rgb/bgr textures, that was causing issues with them 2021-07-19 10:14:13 -04:00
Niklas Haas d6641d7123 kmsdrm: Explicitly set the surface transform and alpha mode
This is required by the specification. Set these to sensible defaults.
Fixes a validation layer error that occurs otherwise.
2021-07-19 10:12:54 -04:00
Niklas Haas 760074270a kmsdrm: Properly zero-initialize CreateInfo structs
As written, these contain undefined stack contents, which in practice
causes crashes/hangs and/or triggers the validation layers (they
complain about `pNext` and `flags` not being NULL).
2021-07-19 10:12:54 -04:00
Cameron Gutman 9170c0c7f8 CI: Add Windows ARM64 builds 2021-07-15 17:10:50 -07:00
Ryan C. Gordon 37d4f003b7
doxygen: Removed some cruft that accumulated during wiki migration. 2021-07-14 17:09:05 -04:00
Ryan C. Gordon c07e5e99c8
wikiheaders.pl: Add --copy-to-header option.
...because I keep mistyping it without the 's' on the end.  :/
2021-07-14 17:07:41 -04:00
Ryan C. Gordon c88eb7a896
Sync wiki -> header. 2021-07-14 17:07:04 -04:00
Ryan C. Gordon f8c1fc49d9
doxygen: Fix all the "\returns" so they work as part of complete sentences. 2021-07-14 14:15:30 -04:00
Ryan C. Gordon 8ec9fbdd0c
wikiheaders.pl: pull in full sections from headers, fix more whitespace. 2021-07-14 11:58:57 -04:00
Ryan C. Gordon 17b4a67aa3
doxygen: We use "\returns" as part of the sentence. 2021-07-14 11:45:06 -04:00
Ryan C. Gordon bab0eb71ce
wikiheaders.pl: Fix some wordwrap whitespace issues. 2021-07-14 11:03:00 -04:00
Ryan C. Gordon 04196a46a5
doxygen: wrap some game controller code examples in "```c" blocks. 2021-07-14 11:03:00 -04:00
Ryan C. Gordon 7390bc0e5e
wikiheaders.pl: Fix \sa tags that (incorrectly!) have "()" appended. 2021-07-14 11:03:00 -04:00
Ryan C. Gordon d115857c6f
wikiheaders.pl: A bunch of work on correct wordwrap and (de)wikify. 2021-07-14 11:02:59 -04:00
Ryan C. Gordon 0ac13dc27f
doxygen: Tweak SDL_FlashWindow brief description.
So "e.g." doesn't look like the end of the sentence to wikiheaders.pl.
2021-07-14 11:02:59 -04:00
Ryan C. Gordon 1f17bc549e
wikiheaders: look for "c++" before "c" in regular expression. 2021-07-14 11:02:59 -04:00
Ryan C. Gordon 269d0773c7
wikiheaders: Ignore doxygen comments that aren't "/**" on a line by itself.
Makes this ignore /** single line comments */
2021-07-14 11:02:58 -04:00
Ryan C. Gordon 8130950e92
wikiheaders: trim whitespace at edges after wordwrapping. 2021-07-14 11:02:58 -04:00
Cameron Cawley 0f1079456d Remove outdated comment about SDL_SoftStretch 2021-07-13 15:44:31 -07:00
Ivan Epifanov 817976da69 VITA: Rewrite and fix RenderCopyEx rotation 2021-07-13 08:45:33 -07:00
Sam Lantinga dc6f044309 Added mapping for the Xbox Series X controller on tvOS 2021-07-12 17:57:21 -07:00
Sam Lantinga 947ad6e13a Added support for the Xbox Series X controller on iOS and tvOS 2021-07-12 17:57:21 -07:00
Cameron Cawley 297ce148e6 CI: Add Android builds to GitHub Actions 2021-07-11 18:58:00 -04:00
Brick 7fe6dbafa3 Reset rawInputEnableCount when RawInput is not supported 2021-07-11 14:51:31 -07:00
scribam 32e736d260 CI: add github actions for windows x86 2021-07-10 13:21:09 -04:00
Ozkan Sezer 5ac81c75fe fixed typo in previous commit 2021-07-10 10:05:40 +03:00
Ozkan Sezer a809d62605 cmake: set SDL_JOYSTICK_RAWINPUT for windows builds
Fixes: https://github.com/libsdl-org/SDL/issues/4412
2021-07-10 10:01:40 +03:00
Sam Lantinga 24059a19c5 The RAWINPUT driver is no longer tied to HIDAPI in any way 2021-07-09 18:11:42 -07:00
h5p9sl e52733af8d Use CMAKE_CURRENT_BINARY_DIR instead of CMAKE_BINARY_DIR
This allows for building with cmake's add_subdirectory() function.
2021-07-09 16:11:40 -07:00
Sam Lantinga f93e9047eb Implemented the timeout in hid_read_timeout() on Android
This fixes detecting PS5 controllers connected over USB
2021-07-08 18:44:50 -07:00
Daniel Gibson e2234ee97c CMake: Fix SOVERSION/SONAME of non-release versions
When building SDL2 from git with CMake, you got libSDL2-2.0.so.1
instead of .0 (as it's the case when building with autotools).
This was caused by using LT_REVISION instead of LT_MAJOR for SOVERSION.

fixes #4310
2021-07-08 14:55:33 -07:00
Daniel Gibson c20207d787 SDL2Config.cmake: Clean it up a bit, remove gcc-style SDL2_LIBRARIES
The GCC-style SDL2_LIBRARIES were lacking the rpath on Linux, which
seems to be implicitly set when linking path/to/libSDL2-2.0.so.0.*
and is explicitly set in the SDL2_LIBRARIES in sdl2-config.cmake
(from some autotools variable), so I removed that hack and the format
remains sth like "path/to/libSDL2main.a;path/to/libSDL2-2.0.so.0.14.1".

It's still in the revision history in case it turns out that some
platform really needs the "-L/path/to/bla/lib -lSDL2main -lSDL2" format
2021-07-08 14:55:33 -07:00
Daniel Gibson 501fe46597 sdl2-config.cmake.in: Make SDL2::SDL2 work with MinGW, fixes #3665
It didn't work at all because shared libs defined in CMake with
add_library() need something like IMPORTED_IMPLIB (pointing to a .dll.a
or .lib for th DLLs) set to link on Windows.
But even with that it didn't work because the order of the libs is very
important: it must be -lmingw32 -lSDL2main -lSDL -mwindows - but
with normal add_library(SDL2::SDL2 SHARED IMPORTED) libs, SDL2 itself
is always linked first.
So I use an "INTERFACE" library (usually used for header-only libs), which
doesn't implicitly/automatically link anything so I can specify the whole
order of the linked libs.
(SDL2::SDL2-static is completely untested)
2021-07-08 14:55:33 -07:00
Daniel Gibson fac6e9f1e2 sdl2-config.cmake.in: Use more CMake variables and less autotools ones
this makes it easier to create a portable sdl2-config.cmake that doesn't
hardcode its path (by replacing the hardcoded prefix with something
like "${CMAKE_CURRENT_LIST_DIR}/../../..")
2021-07-08 14:55:33 -07:00
Daniel Gibson c342696172 Enhanced SDL2Config.cmake to also work on non-Windows
tested Linux; I assume most other Unices are similar; I don't have a Mac
2021-07-08 14:55:33 -07:00
Daniel Gibson 3ea11f9acb Make SDL2Config.cmake export SDL2_LIBRARIES etc (on Windows)
still WIP and other platforms than windows still TODO and open
questions etc

see https://github.com/libsdl-org/SDL/issues/4004
2021-07-08 14:55:33 -07:00
Vladislav Dmitrievich Turbanov f9bf1aeba8
Latest Unifont with OFL is now bundled. (#4268)
* * Latest Unifont with OFL is now bundled.

* * Added a Unifont license file.

Co-authored-by: Vladislav Dmitrievich Turbanov <vladislav@turbanov.ru>
2021-07-08 14:51:16 -07:00
Hanseul Jun 557d0f827f Commenting a false alarm in WIN_GLES_SetupWindow.
When hint SDL_HINT_OPENGL_ES_DRIVER is set to "1" (e.g. for ANGLE support), assertion due to !_this->gl_config.driver_loaded can be causes while EGL is available.
2021-07-08 14:49:40 -07:00
Sam Lantinga d135c0762f Added SDL_GameControllerSendEffect() and SDL_JoystickSendEffect() to allow applications to send custom effects to the PS4 and PS5 controllers
See testgamecontroller.c for an example of a custom PS5 trigger effect
2021-07-08 13:22:41 -07:00
Ozkan Sezer 073cbc40cb SDL_platform.h: define TARGET_OS_SIMULATOR as 0 if not already defined.
c.f.: https://github.com/libsdl-org/SDL/issues/4475
2021-07-08 21:20:02 +03:00
Ozkan Sezer be41cf2dfe CMake: don't blacklist TARGET_OS_SIMULATOR for Metal configuration
7fa5e95b62 enabled it.
2021-07-08 21:20:02 +03:00
Ozkan Sezer 97d4fe9433 removed extra whitespace. 2021-07-08 20:55:10 +03:00
Ozkan Sezer 3da6d2cdde WIN_SetErrorFromHRESULT: kill CR/LF that FormatMessage sticks at the end
Fixes: https://github.com/libsdl-org/SDL_mixer/issues/320
2021-07-08 20:33:50 +03:00
Dean Herbert 8fb95034e8 Avoid warping the cursor to the center of the window when not in relative_warp_mode
When relative mode is enabled and not using warp mode, the cursor is
being clipped to the window. Therefore there is no reason to restore the
cursor position to the center.

Avoiding the warp to center simplifies mouse position event flow, as we
are no longer potentially receiving mouse events for the automated
movement of the cursor and can be (mostly) assured that an incoming
event from the windowing system is that of external means.
2021-07-08 09:27:09 -07:00
Dean Herbert 4359a47b3e Simplify ClipCursor behaviour when RelativeMouseMode is enabled
The implementation of clip logic for relative mode seemed to
unnecessarily limit the usable area to the middle of the window, in a
2x2 pixel region. This has the adverse side effect of moving the
operating system cursor to that location, even if it is in a valid
location in the window.

While in most scenarios this is handled correctly (by storing the
original position of the cursor in the window and restoring when leaving
relative mode), there are edge cases where this clip operation can cause
WM_MOUSEMOVE to fire at a point in time where it counts as a relative
delta from SDL's perspective.
2021-07-08 09:27:09 -07:00
Dean Herbert 3720e254c4 Trim some stray whitespace 2021-07-08 09:27:09 -07:00
Sam Lantinga 170924278d Fixed https://github.com/libsdl-org/SDL/issues/4475
-Wundef errors from clang-11.1 when targeting macOS

Targeting i386 against 10.8 SDK:

In file included from src/SDL_assert.c:21:
In file included from src/./SDL_internal.h:52:
In file included from include/SDL_config.h:33:
include/SDL_platform.h:73:5: error: 'TARGET_OS_TV' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
    ^
1 error generated.

src/joystick/iphoneos/SDL_mfijoystick.m:38:5: error: 'TARGET_OS_IOS' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
    ^
src/joystick/iphoneos/SDL_mfijoystick.m:460:5: error: 'TARGET_OS_TV' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
    ^
2 errors generated.

src/filesystem/cocoa/SDL_sysfilesystem.m:83:6: error: 'TARGET_OS_TV' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
     ^
1 error generated.

Targeting x86_64 against 10.12 SDK:

src/video/SDL_video.c:1492:25: error: 'TARGET_OS_MACCATALYST' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
                        ^
1 error generated.
2021-07-08 09:24:54 -07:00