Luke Street
dc054c8e45
Merge remote-tracking branch 'fork/VK_EXT_metal_surface' into merged
...
# Conflicts:
# src/dynapi/SDL_dynapi.h
# src/thread/SDL_thread_c.h
2022-05-31 14:38:17 -04:00
Luke Street
6948c1a72c
Function prototype updates for SDL_switchaudio.c and SDL_sysjoystick.c
2022-05-31 14:31:24 -04:00
Luke Street
77d6f16906
Merge remote-tracking branch 'upstream/2.0.22' into switch-sdl2-2.0.14-dev
...
# Conflicts:
# .gitignore
# CMakeLists.txt
# configure
# configure.ac
# include/SDL_config.h.cmake
# include/SDL_config.h.in
# sdl2-config.cmake.in
# src/dynapi/SDL_dynapi.h
# src/joystick/SDL_gamecontrollerdb.h
# src/joystick/SDL_sysjoystick.h
# src/video/SDL_video.c
# src/video/khronos/EGL/eglplatform.h
2022-05-31 13:17:31 -04:00
Luke Street
47c92fae24
cocoa/uikit: Use VK_EXT_metal_surface in Vulkan_GetInstanceExtensions
...
Replaces VK_MVK_macos_surface and VK_MVK_ios_surface
2022-05-20 09:55:06 -07:00
Ryan C. Gordon
031c9b03f1
x11: send move/resize events when waiting on fullscreen change.
...
Otherwise we ignore the Configure/etc events when they come in because
the window is already in an identical state as far as SDL is concerned.
Fixes #5593 .
May also fix:
Issue #5572 .
Issue #5595 .
2022-05-20 08:30:46 -07:00
Luke Street
df8b82f8c8
cocoa/uikit: Support VK_EXT_metal_surface
...
Uses VK_EXT_metal_surface (vkCreateMetalSurfaceEXT)
when possible, otherwise falls back to the obsoleted
VK_MVK_macos_surface and VK_MVK_ios_surface.
Fixes #3906
2022-05-19 13:20:17 -07:00
Daniel Brookman
09086aefaa
Fix crash when reading background events for MFi controllers on macOS
...
Enabling GCController.shouldMonitorBackgroundEvents to read background events
for MFi controllers before receiving the first GCControllerDidConnectNotification
is apparently a no-go on macOS (12.3.1 for me), and would crash on attempt.
Apple's documentation is... not great, and doesn't point this out.
This waits for IOS_AddMFIJoystickDevice() to get called down the chain from GCControllerDidConnectNotification, and enables GCController.shouldMonitorBackgroundEvents
if it hadn't been already.
On iOS and tvOS, GCController.shouldMonitorBackgroundEvents is ignored, so
there's no need to check their versions.
(cherry picked from commit d1a3981bf8
)
2022-05-19 22:00:28 +03:00
Simon McVittie
b0a27cb1de
Avoid unintended float -> double conversion in SDL_FRectEqualsEpsilon
...
Resolves: https://github.com/libsdl-org/SDL/issues/5691
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-19 11:47:03 -07:00
Cameron Cawley
f0566702c5
Fix enabling SDL_DYNAMIC_API in OpenWatcom builds
2022-05-19 20:11:10 +03:00
Cameron Cawley
3d52d04977
Remove the '_' prefix from symbol names in Windows OpenWatcom builds
2022-05-19 20:11:10 +03:00
Cameron Cawley
aa51a9791a
Run tests with OpenWatcom on CI
2022-05-19 20:11:10 +03:00
Cameron Cawley
9dfa000bc0
Initial support for building for Windows with OpenWatcom
2022-05-19 20:11:10 +03:00
Cameron Cawley
5ef36ead08
Add some missing tests to Watcom builds
2022-05-19 20:11:10 +03:00
Cameron Cawley
3066873126
Split the common code in test/Makefile.os2 into a separate file
2022-05-19 20:11:10 +03:00
Sam Lantinga
5669743a43
Make sure SDL_CaptureMouse() is only called on the main thread
...
Windows handles mouse capture on a per-thread basis, and capture must be done on the thread used to create a window.
Fixes https://github.com/libsdl-org/SDL/issues/5577
2022-05-19 09:52:47 -07:00
Ozkan Sezer
efa2e6a1ea
SDL_thread.h: use SDL_ThreadFunction for SDL_CreateThreadWithStackSize
2022-05-19 18:55:02 +03:00
Ozkan Sezer
15781a6986
dynapi: fix SDL_DYNAPI_PROC for SDL_iPhoneSetAnimationCallback()
2022-05-19 18:55:02 +03:00
Cameron Cawley
f5cf0e37f7
Remove unused and duplicate defines from SDL_dynapi_overrides.h
2022-05-19 17:23:24 +03:00
Ozkan Sezer
03ebc4397f
dynapi: add missing SDLCALL for SDL_TLSSet's dtor param.
2022-05-19 14:01:10 +03:00
Pierre Wendling
973424d9cb
Add for-each macros to clang-format.
2022-05-19 01:31:29 -07:00
Pierre Wendling
501a499180
Add clang-format on/off comments where necessary.
...
Comments were added in places where INDENT-ON/OFF comments are. Places
like stdlib's asm don't need it as clang-format doesn't try to indent it.
2022-05-19 01:31:29 -07:00
Pierre Wendling
c6a77971bd
Add a clang-format config file.
...
tmp
2022-05-19 01:31:29 -07:00
Sam Lantinga
0e6d4baa6b
Fixed compile warning on gcc 11
2022-05-19 01:23:24 -07:00
Sam Lantinga
c7dff3a22e
Attempt to get the X1 and X2 button state on X11 by using the current event state instead of direct X11 query.
2022-05-19 00:35:22 -07:00
Sam Lantinga
57130b75a9
Revert "x11: get x1/x2 button state in GetGlobalMouseState"
...
This reverts commit 3fcc2cb500
.
Button4 and Button5 are for the scrollwheel, not the extended buttons.
I don't know of a way to query the state of the extended buttons using X11.
2022-05-19 00:31:20 -07:00
Sam Lantinga
47f1cb550d
Fixed picking up the correct mapping for virtual controllers on Android
...
Fixes https://github.com/libsdl-org/SDL/issues/5662
2022-05-18 23:48:15 -07:00
Sam Lantinga
f7b774a7e0
Fixed build error on Linux if HAVE_INOTIFY isn't defined
...
Fixes https://github.com/libsdl-org/SDL/issues/5682
2022-05-18 17:59:17 -07:00
Sam Lantinga
f9a9d3c8d4
Also restore previous capture window if CaptureMouse() fails
2022-05-18 17:23:49 -07:00
Sam Lantinga
7044452dd6
Handle recursion in SDL_UpdateMouseCapture()
...
Fixes https://github.com/libsdl-org/SDL/pull/5608
2022-05-18 17:15:45 -07:00
Ozkan Sezer
dbd54dd708
adjust dynapi after commit 0cca71a
changes for SDL_qsort and SDL_bsearch
2022-05-19 03:00:04 +03:00
Sam Lantinga
e19a9a7931
Fixed a message box getting the mouse capture state out of sync
2022-05-18 15:34:07 -07:00
Cameron Cawley
622311c016
Add extra XInput structures and defines for older SDKs
2022-05-18 15:04:42 -07:00
Cameron Cawley
c8eea02071
Fix C89 build errors in Windows builds
2022-05-18 15:03:15 -07:00
Cameron Cawley
0cca71a846
Use SDLCALL for callbacks in public APIs
2022-05-18 15:01:27 -07:00
Cameron Cawley
ffab9f46b5
Avoid clashing with system headers when redefining standard library functions
2022-05-18 16:44:17 -04:00
Simon McVittie
4cb57bf199
.editorconfig: Automatically configure multiple text editors
...
See editorconfig.org for details of the format, which is understood by
multiple text editors, either directly or via plugins.
This is not comprehensive, but should cover most of the SDL codebase.
Please extend as needed.
Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-05-18 10:21:42 -07:00
Sam Lantinga
06aca7edaa
Fixed warping back into the window when gaining focus with warp relative mode enabled
2022-05-18 10:10:51 -07:00
Sam Lantinga
0ffd985972
Check to see if the file exists in the base path before returning it
2022-05-18 10:10:51 -07:00
pionere
c4cf63f812
improve test-configuration
...
- testkeys 'NEEDS_DISPLAY'
- 'disable' relevant tests in case DUMMY audio/video is disabled
2022-05-18 09:06:56 -07:00
Sam Lantinga
b44241ab2f
Don't send mouse events when warping in relative mode
...
This fixes games which set relative mode and then did mouse warping at the same time
Reference https://github.com/libsdl-org/SDL/issues/5609
2022-05-18 08:56:09 -07:00
pionere
ea15253220
fix GetNearbyFilename
...
- fix memory leak due to variable 'base'
- fix usage of uninitialized variable (path)
2022-05-18 08:30:34 -07:00
Ivan Epifanov
8c5bda6acd
Vita: remove Vita-specific RWOps code
2022-05-18 08:29:25 -07:00
Sam Lantinga
aa6ea607d9
Fixed whitespace
...
Whitespace inconsistencies reported in https://github.com/libsdl-org/SDL/pull/5673
2022-05-18 06:58:14 -07:00
Ryan C. Gordon
56665e1d9d
cocoa: Try to use better system cursors.
...
These try to pull from the .pdf files that are installed with
macOS, which fit our needs better, and fall back to the most
reasonable defaults available from NSCursor if we can't load
them.
Since these are installed under /System, they should be sandbox
accessible, and if this totally fails, it should still go on,
albeit with a less good cursor.
Reference Issue #2123 .
2022-05-17 12:51:08 -04:00
Ryan C. Gordon
a12ffbd532
testcustomcursor: Log the current cursor type as it changes.
...
So you know what you're looking at.
2022-05-17 12:49:36 -04:00
Alex Szpakowski
e9c7b5191c
macOS: Fix reference counts of internal window data.
...
Fixes crashes when destroying or recreating a window (#5664 ).
2022-05-16 18:17:27 -07:00
Ozkan Sezer
f8e14ad25a
disable dynapi for os/2, at least for now. (see bugs #5667 and #5669.)
2022-05-17 01:35:24 +03:00
Ozkan Sezer
0c05ddd9ff
SDL_malloc.c: workaround calling convention issues for real_xxx procs.
...
(cherry picked from commit ec1a0f62dd
)
2022-05-17 01:34:28 +03:00
Ozkan Sezer
a48004952d
disable dynapi for os/2, at least for now. (see bugs #5667 and #5669.)
2022-05-17 01:33:20 +03:00
Ozkan Sezer
ec1a0f62dd
SDL_malloc.c: workaround calling convention issues for real_xxx procs.
2022-05-17 01:33:02 +03:00