Commit Graph

11938 Commits

Author SHA1 Message Date
Ozkan Sezer 272010b612 cmake: really fix detection of pthread_setname_np() on Apple platforms. 2023-02-13 11:56:10 +03:00
Ozkan Sezer f7f61af12b cmake: fix detection of pthread_setname_np() on Apple platforms. 2023-02-13 11:55:40 +03:00
Sylvain 93ed3148ba Fixed bug #7302 - Memory 'leak' in SDL_SetMouseSystemScale() 2023-02-13 09:42:12 +01:00
Anonymous Maarten 236d26b480 cmake: add `-F <SDL3-framework-parent-folder>` compile option in CMakeLists.txt 2023-02-13 05:26:57 +01:00
Anonymous Maarten d0b39890d2 cmake: include_guard() is not needed 2023-02-13 04:55:46 +01:00
Sylvain eea4711110 gendynapi.py: add option to check doc formating (eg \param \returns \since) 2023-02-12 20:43:30 +01:00
Sylvain 81c94a165c Add \since docs where missing and resets some to 3.0.0
- remove a \returns
2023-02-12 20:43:11 +01:00
Sylvain 3d93b07d5b Documentation \param fixes 2023-02-12 08:21:36 -08:00
Sylvain 49e47b523a Update `\returns` to the generic form 2023-02-12 08:21:02 -08:00
Sylvain 612584277c Fix build documentation 2023-02-12 09:54:36 +01:00
Sylvain e9af964cf4 More `\param` added for SDL function in stdinc.h 2023-02-12 09:50:38 +01:00
Sylvain 43c08170af Add missing '\param' documentation 2023-02-12 09:42:13 +01:00
Sylvain ce366facaa Add missing \returns, change "return" to "returns" to have same naming 2023-02-12 09:22:25 +01:00
Francisco Javier Trujillo Mata b728de788e Fixed audio 2023-02-11 13:23:08 -08:00
Frank Praznik 4a6f3cf47e x11: Set the window position when entering fullscreen
Set the window position when entering fullscreen as both real Xorg and XWayland need this in order for the window to be on the correct display.
2023-02-11 14:44:02 -05:00
Frank Praznik d6a19c8cc6 video: Use the explicit fullscreen display for a window unless the window was moved
When an exclusive fullscreen display is specified, it overrides any positioning, including from driver specific functions. Allows for the proper placement of fullscreen windows on macOS and Windows when the floating window is on a display that differs from the one specified by the exclusive fullscreen mode.

 A specific position-only function has been split out for use when a window has been moved.
2023-02-11 14:44:02 -05:00
Sam Lantinga 68e2f23066 Sorted controller list 2023-02-10 17:18:02 -08:00
Alfredo Escobar 76552e4780 Add Hori Pokken Tournament DX Pro Pad 2023-02-10 17:16:26 -08:00
Sam Lantinga e4face7c1d Fixed the share button on the ThrustMaster eSwap PRO Controller Xbox 2023-02-10 16:46:21 -08:00
Sam Lantinga b55bb02723 Constrain the mouse position before it's used to generate mouse deltas
Also clamp the mouse position to the maximum of *max and the last mouse position

Fixes https://github.com/libsdl-org/SDL/issues/7221#issuecomment-1426054481
2023-02-10 09:08:12 -08:00
Sam Lantinga 144390f8fc Fixed renaming suggestion for SDL_WINDOWEVENT_CLOSE 2023-02-10 06:48:54 -08:00
Sam Lantinga 13d9e41c3f SDL_WINDOWEVENT_SIZE_CHANGED was renamed SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED 2023-02-10 06:38:14 -08:00
Sam Lantinga 69a6796476 Note that the coordinates in SDL_GetDisplayForPoint() and SDL_GetDisplayForRect() are screen coordinates 2023-02-10 06:31:10 -08:00
Sam Lantinga 449b2289c8 Remove renaming for SDL_GetDisplayDPI() 2023-02-10 06:31:09 -08:00
Sylvain 7c4ec1867b Remove some vim config lines 2023-02-10 11:00:48 +01:00
Sylvain 26f27a9e5a Update README-migration 2023-02-10 09:30:31 +01:00
Sylvain 32d30944a1 SDL_GetNumTouchFingers(): 0 is a valid value. negative is automatically an error 2023-02-10 09:30:31 +01:00
Sylvain a2f3711c80 SDL_AndroidGetExternalStorageState(): return 0 on success, and fills *state with flags 2023-02-10 09:30:31 +01:00
Bruce Mitchener a8e89f2567 emscripten: Update deprecated calls to EM_ASM*.
`EM_ASM_` and `EM_ASM_INT_V` are calls that have been deprecated
for a long time.

Since the return value isn't used for the call to `EM_ASM_`, it
can be replaced with `EM_ASM`.

`EM_ASM_INT_V` is now (for the last few years) `EM_ASM_INT`.
2023-02-09 23:10:17 -08:00
Sam Lantinga b9773be3b3 Don't clamp mouse coordinates until they're fully outside the containing area
A window 1920x1080 pixels wide at 125% scaling will have a width and height of 1536x864, but at pixel (1919,1079) the mouse coordinate will be (1535.2,863.2), which is within the bounds of 1536x864, but larger than (1535,863).
2023-02-09 18:29:47 -08:00
Sam Lantinga 5b77ad54c4 Fixed order and constness of parameters to SDL_ConvertAudioSamples() 2023-02-09 17:49:35 -08:00
Sam Lantinga fa599c7548 Fixed SDL_GetRendererOutputSize renaming 2023-02-09 17:31:44 -08:00
Sam Lantinga e65e2c8ed7 SDL_CloseJoystick() should return void, not int 2023-02-09 17:26:16 -08:00
Sam Lantinga 9ff15e5382 Don't change M_PI in application code, that's not an SDL symbol 2023-02-09 17:26:15 -08:00
Anonymous Maarten ff82341ce9 cmake: allow find_package from build directory (requires CMake 3.26) 2023-02-09 17:20:28 -08:00
Anonymous Maarten b8adf90aa3 cmake: check again for unknown documentation commands 2023-02-09 17:20:28 -08:00
Anonymous Maarten cc0fa00049 cmake: include directories of (generated) dependencies as SYSTEM 2023-02-09 17:20:28 -08:00
Sam Lantinga a9650d440a Fixed MFI controller being opened while HIDAPI controller was being opened
This was the callstack:
    frame #3: 0x00000001004e1930 libSDL3.1.0.0.dylib`IOS_AddJoystickDevice(controller=0x0000600003b0c000, accelerometer=SDL_FALSE) at SDL_mfijoystick.m:528:14
    frame #4: 0x00000001004e1a54 libSDL3.1.0.0.dylib`__IOS_JoystickInit_block_invoke(.block_descriptor=0x0000000100547760, note=@"GCControllerDidConnectNotification") at SDL_mfijoystick.m:673:45
    frame #5: 0x000000018601e578 CoreFoundation`__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 128
    frame #6: 0x00000001860bc074 CoreFoundation`___CFXRegistrationPost_block_invoke + 88
    frame #7: 0x00000001860bbfbc CoreFoundation`_CFXRegistrationPost + 440
    frame #8: 0x0000000185fefbac CoreFoundation`_CFXNotificationPost + 708
    frame #9: 0x0000000186edc72c Foundation`-[NSNotificationCenter postNotificationName:object:userInfo:] + 88
    frame #10: 0x000000019b054a18 GameController`__60-[_GCControllerManagerAppClient _onqueue_publishController:]_block_invoke + 156
    frame #11: 0x0000000185dc19dc libdispatch.dylib`_dispatch_call_block_and_release + 32
    frame #12: 0x0000000185dc3504 libdispatch.dylib`_dispatch_client_callout + 20
    frame #13: 0x0000000185dd1d1c libdispatch.dylib`_dispatch_main_queue_drain + 928
    frame #14: 0x0000000185dd196c libdispatch.dylib`_dispatch_main_queue_callback_4CF + 44
    frame #15: 0x000000018606ad6c CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
    frame #16: 0x00000001860287ec CoreFoundation`__CFRunLoopRun + 2036
    frame #17: 0x00000001860278a4 CoreFoundation`CFRunLoopRunSpecific + 612
    frame #18: 0x00000001003b1194 libSDL3.1.0.0.dylib`process_pending_events at hid.c:509:9
    frame #19: 0x00000001003aebe8 libSDL3.1.0.0.dylib`PLATFORM_hid_open_path(path="USB_054c_05c4_0x11a104290", bExclusive=0) at hid.c:823:2
    frame #20: 0x00000001003b051c libSDL3.1.0.0.dylib`SDL_hid_open_path_REAL(path="USB_054c_05c4_0x11a104290", bExclusive=0) at SDL_hidapi.c:1419:19
    frame #21: 0x00000001004dabdc libSDL3.1.0.0.dylib`HIDAPI_SetupDeviceDriver(device=0x0000600003518000, removed=0x000000016fdfee3c) at SDL_hidapijoystick.c:399:19
    frame #22: 0x00000001004da890 libSDL3.1.0.0.dylib`HIDAPI_AddDevice(info=0x000060000212c2d0, num_children=0, children=0x0000000000000000) at SDL_hidapijoystick.c:843:5
    frame #23: 0x00000001004d9148 libSDL3.1.0.0.dylib`HIDAPI_UpdateDeviceList at SDL_hidapijoystick.c:1000:21
    frame #24: 0x00000001004d9940 libSDL3.1.0.0.dylib`HIDAPI_JoystickDetect at SDL_hidapijoystick.c:1205:13
    frame #25: 0x00000001003bc6d8 libSDL3.1.0.0.dylib`SDL_UpdateJoysticks_REAL at SDL_joystick.c:1703:9
    frame #26: 0x00000001003a13a8 libSDL3.1.0.0.dylib`SDL_PumpEventsInternal(push_sentinel=SDL_FALSE) at SDL_events.c:855:9
    frame #27: 0x00000001003a1340 libSDL3.1.0.0.dylib`SDL_PumpEvents_REAL at SDL_events.c:879:5
    frame #28: 0x000000010038b380 libSDL3.1.0.0.dylib`SDL_PumpEvents at SDL_dynapi_procs.h:572:1
    frame #29: 0x0000000100004524 testgamepad`loop + 40
    frame #30: 0x00000001000063d8 testgamepad`main + 2140
2023-02-09 12:07:11 -08:00
Ozkan Sezer ae91dcbcf4 fix dynapi after commit dc74a67a 2023-02-09 22:50:00 +03:00
Sylvain dc74a67a57 SDL_UnlockTexture: change from 'int' to 'void' 2023-02-09 20:17:27 +01:00
Sylvain cee245b6a9 SDL_*SceenSaver(): change return value to int. // add SDL_Unsupported() errors 2023-02-09 08:16:46 -08:00
Sylvain e2e5e670bf Remove returns int from Destroy/Close/Unlock functions 2023-02-09 07:57:14 -08:00
Linus Probert 3bd737d44c Add error returns to void functions that can fail/set errors.
This takes care of the last set of void functions that could
potentially be shifted to instead return an int indicating success and
setting an error in case of an error.
2023-02-09 07:23:21 -08:00
Sylvain b305d9e3c0 Change return type from void to int for audio function. Eventually set invalid parameter error. 2023-02-08 17:43:44 -08:00
Sam Lantinga 824b9b0a58 Removed SDL_GetDisplayDPI()
This function wasn't consistently correct across platforms and devices.

If you want the UI scale factor, you can use display_scale in the structure returned by SDL_GetDesktopDisplayMode(). If you need an approximate DPI, you can multiply this value times 160 on iPhone and Android, and 96 on other platforms.
2023-02-08 17:35:54 -08:00
Sam Lantinga b7c6fec10a Make sure we synchronously re-enable USB reporting mode for Switch controllers (thanks @SortaCore!)
Fixes https://github.com/libsdl-org/SDL/issues/3450
2023-02-08 14:22:39 -08:00
Sam Lantinga 50575ed223 Note the Google Stadia controller doesn't support rumble over Bluetooth 2023-02-08 14:16:24 -08:00
Sam Lantinga 00e02de77b Fixed mis-detecting the share button on the Xbox controller over NDIS 2023-02-08 14:16:21 -08:00
Sam Lantinga d1c72bb0bc Dynamically update the serial number if it isn't available at first
This happens for Xbox One controllers using newer firmware connected over NDIS
2023-02-08 14:16:17 -08:00
Sylvain c5c94a6be6 Change return type from void to int, for functions that set an error
(SDL_SetError(), SDL_OutOfMemory(), SDL_Unsupported(), SDL_InvalidParam())

Update prototype to forward errors to generic layer, for the functions:
MoveCursor, WarpMouse, GL_DeleteContext, GetDisplayModes.

Check invalid parameter in SDL_SetTextInputRect() generic layer.
2023-02-07 13:51:45 -08:00