Commit Graph

10306 Commits (4e98ba612b455016aa6d2b084bcb463ba9530b1d)

Author SHA1 Message Date
Noel Berry 00452e47fa
Adding SDL_GetWindowSizeInPixels for window size in pixels (#6112) 2022-08-24 11:25:13 -07:00
Sam Lantinga 70c781c803 Fixed build warning because of redefining string functions 2022-08-24 10:25:56 -07:00
antonino 5f79cd1600 Fixed spacing 2022-08-24 10:10:49 -07:00
antonino dd68eb5c01 free drm prop before returning 2022-08-24 10:10:49 -07:00
Sam Lantinga 970344719a Fixed the Nintendo Switch Pro mappings on iOS/tvOS 2022-08-24 09:39:01 -07:00
Sam Lantinga 1fc7f68118 Document that it's not possible to use the HIDAPI driver for PS3 controllers on Windows 2022-08-24 06:38:36 -07:00
Anonymous Maarten 5eb0f4328d cmake: always create SDL2::SDL2main target in autotools' cmake config script 2022-08-24 06:20:28 -07:00
Anonymous Maarten dc2ef31c29 cmake: create SDL2::SDL2main target in Apple framework official release 2022-08-24 06:20:28 -07:00
Sam Lantinga 645b0f6abf Enable HIDAPI PS3 support by default on macOS 2022-08-24 01:30:29 -07:00
Sam Lantinga 3ed8e219a5 Fixed building HIDAPI libusb support on Windows 2022-08-24 01:25:14 -07:00
Sam Lantinga 3d62ebdbf6 Fixed HIDAPI PS3 support on macOS 2022-08-24 00:34:30 -07:00
Sam Lantinga 6ac6accd33 Added SDL_hidapi_ps3.c to the Xcode project 2022-08-23 23:05:11 -07:00
Sam Lantinga aaee6e242c Added missing file 2022-08-23 22:56:48 -07:00
Sam Lantinga 7cfef177c1 Added SDL_hidapi_ps3.c to the Windows projects 2022-08-23 22:53:43 -07:00
Sam Lantinga b6f96b69aa Initial HIDAPI driver support for the PS3 controller 2022-08-23 22:45:37 -07:00
Sam Lantinga 50c5d23f7d Round coordinates so very small floating point values don't turn into 0x80000000
e.g. SDL_RenderDrawLineF(renderer, -1e20, -1e20, 10, 10);

Fixes https://github.com/libsdl-org/SDL/issues/6116
2022-08-23 07:42:48 -07:00
Sam Lantinga b6a3d76225 Look up mappings by GUID in two passes: first with CRC, second without 2022-08-23 07:24:21 -07:00
Ludovico de Nittis 4df64027fc .editorconfig: Use correct path for wayland-protocols
The Wayland protocol XML files are stored in the root directory of SDL
and not in `src`.

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2022-08-23 06:28:04 -07:00
Sam Lantinga 277b033e78 Refactor joystick GUID creation 2022-08-22 19:44:14 -07:00
antonino aae566e196 Use SDL_bool 2022-08-22 18:43:43 -07:00
antonino e3ea9b5b7c restore vrr state on exit 2022-08-22 18:43:43 -07:00
antonino 450e9857cc Use SDL_TRUE and SDL_FALSE 2022-08-22 18:43:43 -07:00
antonino 605b50fcd9 kmsdrm: added missing checks 2022-08-22 18:43:43 -07:00
Sam Lantinga c1e0873940 Added the CRC of the joystick name to the GUID
This will make it possible to have mappings for different controllers
that have the same VID/PID. This happens frequently with some generic
controller boards that have been reused in many products.

Fixes https://github.com/libsdl-org/SDL/issues/6004
2022-08-22 18:22:35 -07:00
Sam Lantinga 20715fa014 Fixed build errors 2022-08-22 17:09:42 -07:00
Sam Lantinga 92b3c53c92 Added a hint SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE to control whether to use system mouse acceleration on raw relative motion.
This is currently only implemented on Windows, and "Enhanced pointer
precision" mode is not quite correct.
2022-08-22 16:48:09 -07:00
yurii levchenko 3ce3594e38 Split SDLSurface to public class
Add SDLActivity method createSDLSurface
2022-08-22 14:57:15 -07:00
Sam Lantinga d166f5ef76 Fixed uninitialized variable warning 2022-08-22 14:10:54 -07:00
Sam Lantinga b2819e43a7 Send SDL_CONTROLLERDEVICEREMOVED for all joysticks because we don't know after the fact whether it was a game controller.
Fixes https://github.com/libsdl-org/SDL/issues/2092
2022-08-22 13:10:57 -07:00
Sam Lantinga 0e61c106f5 Don't calculate relative mouse motion if we don't have a valid position
Fixes https://github.com/libsdl-org/SDL/issues/1928
2022-08-22 12:49:41 -07:00
slime b204db1e6b cocoa: change Shape data to use ObjC objects instead of C structs.
Fixes #6089
2022-08-21 14:49:00 -07:00
Frank Praznik 057086e389 wayland: Add high resolution scroll wheel support
Update the Wayland core protocol spec file and add support for the new axis_value120 event to handle high resolution scroll wheels.

The axis_value120 replaces the axis_discrete event, which is no longer sent as of version 8 of the protocol.  Note that unlike the axis_discrete event, no mention in the spec is made regarding how many axis_value120 events may occur per-axis per-frame, so the values are accumulated and committed when the pointer frame event occurs.
2022-08-21 08:54:58 -07:00
Frank Praznik d731ad769d wayland: Fix include order when building with libdecor
The libdecor header internally includes wayland-client.h, which pulls in the wayland-client-protocol.h file from the system include path and overrides the local one generated from the included Wayland protocol spec files. Move the Wayland protocol header inclusion above the libdecor header inclusion to ensure that the locally generated protocol header is used instead.
2022-08-21 08:54:58 -07:00
Ryan C. Gordon 4ca7b378c5
x11: Specify windowed dimensions when creating fullscreen windows.
This lets the window manager adjust the window correctly if it ever
leaves fullscreen mode.

Fixes #5725.
2022-08-21 11:35:14 -04:00
SDL Wiki Bot a7066c527a Sync SDL wiki -> header 2022-08-21 14:05:04 +00:00
Anonymous Maarten 996eb2edb3 cmake: add library directories & pthread to imported targets of sdl2-config.cmake
This fixes linking to SDL2::SDL2-static on systems where external libraries such as X11 are not in a standard location.
Pthread also needs special care.
2022-08-20 19:16:48 -07:00
SDL Wiki Bot 8fb1b50a9e Sync SDL wiki -> header 2022-08-20 17:50:04 +00:00
Sam Lantinga ffab139646 Fixed minimized window detection when handling WM_WINDOWPOSCHANGED
When minimizing a window, we get this sequence of events:
WM_WINDOWPOSCHANGING
WM_GETMINMAXINFO
WM_NCCALCSIZE
WM_WINDOWPOSCHANGED - IsIconic() is true
WM_MOVE
WM_SIZE - SDL sees minimized state here

When restoring a window, we get this sequence of events:
WM_WINDOWPOSCHANGING
WM_GETMINMAXINFO
WM_NCCALCSIZE
WM_NCPAINT
WM_ERASEBKGND
WM_WINDOWPOSCHANGED - IsIconic() is false
WM_MOVE
WM_SIZE - SDL sees restored state here

On Windows 10 a minimized window has a non-empty client rect, so we were delivering a minimized size before SDL knows that the window is minimized, and then ignoring the restored size when handling the restore message.

The fix is to use IsIconic() which returns the correct window state when WM_WINDOWPOSCHANGED is actually delivered.
2022-08-19 17:28:31 -07:00
Oleg Derevenetz a204ef50bb Use __ARM_ARCH instead of __ARM_ARCH__ 2022-08-19 13:15:28 -07:00
Sam Lantinga 5a3adbfdb2 Added the hint SDL_HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED to control whether the player LED is set on Xbox 360 controllers 2022-08-19 11:11:25 -07:00
Sam Lantinga 52b6899a6b Added hints for more fine grained control over HIDAPI Xbox controller support 2022-08-19 11:11:23 -07:00
Anonymous Maarten bf327b52bd autotools: run ./autogen.sh 2022-08-19 19:01:04 +02:00
Luke Street 2b93f6e148 cocoa/uikit: Use VK_EXT_metal_surface in Vulkan_GetInstanceExtensions
Replaces VK_MVK_macos_surface and VK_MVK_ios_surface
2022-08-19 09:48:22 -07:00
Luke Street 029a9b2fa1 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-08-19 09:48:22 -07:00
antonino ad874536a4 kmsdrm: enable vrr on displays that support it 2022-08-19 09:45:03 -07:00
Sam Lantinga 6e9c14e550 Updated to version 2.25.0 for development 2022-08-19 09:38:42 -07:00
Sam Lantinga 8c9beb0c87 Updated to version Updated to version 2.24.0 for release 2022-08-19 08:44:09 -07:00
Sam Lantinga 6e007c36e7 Add null termination to Wayland_data_source_get_data() if requested
Fixes https://github.com/libsdl-org/SDL/issues/6083
2022-08-18 19:05:55 -07:00
Sam Lantinga 948dbe7d3f Don't include the null terminator in Wayland clipboard text
Fixes https://github.com/libsdl-org/SDL/issues/6083
2022-08-18 16:24:20 -07:00
Sam Lantinga f6b81125b3 Always define SDL_COMPILE_TIME_ASSERT as static_assert() in C++
Apparently some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode.

Fixes https://github.com/libsdl-org/SDL/issues/6078
2022-08-18 16:06:42 -07:00