Commit graph

7066 commits

Author SHA1 Message Date
Frank Praznik b2cfcbdb64 wayland: Support new high-DPI system
- Adds support for scaled fullscreen modes
- General cleanup of scale factor setting and usage
2023-01-26 11:11:30 -08:00
Ozkan Sezer b462027c53 SDL_test_common.c: minor warning fix (SDL_AudioDeviceID is unsigned) 2023-01-26 22:05:47 +03:00
Sam Lantinga 364db52ca3 Moved testautomation data out of SDL_test library 2023-01-26 10:25:44 -08:00
Frank Praznik 6895e1700f video: Ensure that the closest returned video mode match always has a valid scale value 2023-01-25 20:18:45 -08:00
Sam Lantinga a37f2aed7e Hook up Android_ScreenDensity to convert pixels to screen coordinates on Android
Fixes https://github.com/libsdl-org/SDL/issues/7149
2023-01-25 13:06:42 -08:00
Sam Lantinga 9bbc402b81 Take the display scale into account in SDL_GetWindowSizeInPixels() 2023-01-25 13:06:42 -08:00
Sylvain 73dc327c84 Android get the display Density 2023-01-25 09:28:21 -08:00
Sam Lantinga 6a27188023 SDL_DisplayMode now represents physical pixels and has added a display scaling factor
Work in progress on https://github.com/libsdl-org/SDL/issues/7134
2023-01-25 09:26:59 -08:00
Sam Lantinga 4696c9556b
SDL 3.0 is going to be high DPI aware and officially separates screen… (#7145)
* SDL 3.0 is going to be high DPI aware and officially separates screen coordinates from client pixel area

The public APIs to disable high DPI support have been removed

Work in progress on https://github.com/libsdl-org/SDL/issues/7134
2023-01-25 01:23:17 -08:00
Sylvain 78cc95e34e Rename internal GetDisplayDPI to GetDisplayPhysicalDPI 2023-01-25 00:04:00 -08:00
Sylvain 724d92fd65 Rename SDL_GetDisplayDPI to SDL_GetDisplayPhysicalDPI
to avoid confusion with logical DPI
2023-01-25 00:04:00 -08:00
Sam Lantinga d496d187c5 Document that the pitch value may be zero for surfaces that will be filled in by the application later.
Also verify that the pitch isn't zero for surfaces with valid pixels

Fixes https://github.com/libsdl-org/SDL/issues/7143
2023-01-24 22:51:16 -08:00
Anonymous Maarten 3cb819ac48 vita: fix PVR_PSP2 (GLES) + gl4es4fita (GL) 2023-01-25 00:23:05 +01:00
Sam Lantinga 14eb8db152 Fixed build 2023-01-24 14:01:01 -08:00
Sam Lantinga a06a593aa6 Renamed SDL_GetGamepadNumTouchpads and SDL_GetGamepadNumTouchpadFingers to match the new convention 2023-01-24 13:47:30 -08:00
Sylvain 052b14eb65 Add SDL_ConvertAudioSamples() helper function 2023-01-24 08:26:09 -08:00
Sam Lantinga 7b50bae524 Renamed SDL events for clarity
Fixes https://github.com/libsdl-org/SDL/issues/6877
2023-01-24 07:26:48 -08:00
ds-sloth d020dd89ba Support MIN/MAX blend on opengles2 2023-01-23 06:11:36 -08:00
Sam Lantinga b6646f4de5 Use nanosecond timestamp for sensors (thanks @1bsyl!) 2023-01-23 05:34:24 -08:00
Frank Praznik 34bb0735d8 video: Don't resize moved fullscreen windows if the display mode switch failed
If an exclusive fullscreen window is moved between displays, SDL_UpdateFullscrrenMode can kick the window out of fullscreen if the display onto which it was moved doesn't have a matching video mode. Check the return code and clear the fullscreen flag and skip the resize if the window is no longer fullscreen.
2023-01-22 14:00:54 -08:00
Frank Praznik 8f8746cc1b video: Return an error on failure to set the video mode
If SDL_UpdateFullscreenMode() fails to find a matching mode for the window, it will restore the window to its previous state, but still returns a success code of 0. Return an error code of -1 if no matching display mode can be found.
2023-01-22 14:00:54 -08:00
ds-sloth 38697e832a Support MIN/MAX blend on OpenGL + ES 2023-01-22 13:49:44 -08:00
Sylvain 64bc0a1612 Remove AudioCVT interface in favor of SDL_AudioStream 2023-01-22 11:31:30 -05:00
raphasamp 9211c0b639 Update SDL_vitagles_pvr.c
This was broken unintentionally during #6545.
2023-01-22 17:32:00 +03:00
PARTY MAN X fb11918758 Blacklist Konami Amusement Controllers From HIDAPI.
Fixes issue #7118 by adding all Konami Amusement controllers to the
blacklist.  Additionally, the blacklist is changed to exclude a whole
vendor when the PID 0x0000 is used.

(cherry picked from commit a44b646105)
2023-01-21 22:05:21 -08:00
Sam Lantinga bd1115fa33 Make sure subsystems are noted as initialized during initialization
This fixes issues with SDL_WasInit(X) returning false if called from an event filter during initialization
2023-01-20 17:06:49 -08:00
Sam Lantinga c4db0725e4 Enable paddles on the Xbox Elite controller when connected over USB 2023-01-20 09:31:22 -08:00
Frank Praznik 5d5d39b190 video: Don't resize moved, fullscreen windows when mode switching is being emulated
When a driver is emulating mode changes, the display bounds are always the native desktop size, not those of the video mode being emulated. This can result in incorrectly setting the size of fullscreen Wayland windows. Don't resize fullscreen windows to the display dimensions when mode switching is emulated.

Renames the quirk flag from VIDEO_DEVICE_QUIRK_DISABLE_DISPLAY_MODE_SWITCHING to VIDEO_DEVICE_QUIRK_MODE_SWITCHING_EMULATED to better reflect its purpose.
2023-01-19 15:07:29 -08:00
Frank Praznik 5ba9e07366 wayland: Remove fullscreen window moving code
SDL now handles moving fullscreen windows on move events in the video core, so Wayland doesn't have to do it manually anymore.
2023-01-19 15:07:29 -08:00
Guldoman 6c06f5ce93 wayland: Set APPLICATION scancode name to Menu
This mimics the behavior of the other platforms.
2023-01-19 15:05:41 -08:00
Sam Lantinga 14695a714f Set the default priority level of SDL_LOG_CATEGORY_ERROR to SDL_LOG_PRIORITY_ERROR
This way SDL_LogError() will show errors by default.

Fixes https://github.com/libsdl-org/SDL/issues/7105
2023-01-19 08:04:40 -08:00
Sam Lantinga c8dfc6b475 Fixing window being incorrect size when using win+shift+arrow to move new big picture mode between displays
*When changing the display of a window, if it's a fullscreen window, resize it to the size of the new display

CR: @saml
2023-01-19 07:43:01 -08:00
Frank Praznik 423a82cd4b wayland: Enforce or override libdecor minimum window size
libdecor plugins can change the min/max window size values internally to enforce a minimum window size, and errors and crashes can result if the window size is below the internal limit.

On versions of libdecor >= 0.1.1, the minimum width and height can be queried and the minimum required window size will be enforced. The application requested window size is still respected, however, the actual window may be slightly larger than the drawable area to accommodate the required libdecor minimum size.

On version 0.1.0 of libdecor, which lacks the function to retrieve the minimum size, the internal limits are overridden before committing a frame, so that the internal limits always match the window size as a workaround, even if the window is technically smaller than the plugin would normally allow.
2023-01-18 10:28:01 -08:00
Fabian Greffrath 9b861d2ea4
add support for libsamplerate's "linear" resampling mode
Fixes #6998

(cherry picked from commit 8efa1f8fc6)
2023-01-16 23:49:26 -05:00
Sylvain 69253c542a SDL_test_harness: fix memory leak when generated seed 2023-01-16 10:41:43 +01:00
Sylvain 4156e6f52e SDL_CreateAudioStream: check for invalid parameters 2023-01-16 09:24:27 +01:00
Eric Wasylishen 67c91353e0 Handle DPI scaling in SDL_GetWindowSurface
Fixes DPI awareness of testdrawchessboard (previously, the surface was
being created in points instead of pixels, resulting in the demo app
only drawing in a corner of the screen on High-DPI displays)

*_CreateWindowFramebuffer()/*_UpdateWindowFramebuffer(): are updated
to use SDL_GetWindowSizeInPixels instead of SDL_GetWindowSize() or
window->w/window->h.

Most of the _CreateWindowFramebuffer backends are untested except
for Windows.

Fixes #7047
2023-01-15 12:57:42 -08:00
Anonymous Maarten fc72ee5775 haiku: cast pointer to SDL_FunctionPointer 2023-01-14 15:25:22 +01:00
Sam Lantinga 8238a128c3 Fixed build on Steam Link hardware 2023-01-13 16:37:56 -08:00
Sam Lantinga decbbb0499 Updated API for SDL_JoystickID sign change 2023-01-13 14:20:59 -08:00
Sam Lantinga bf53183c8b Fixed building on Raspberry Pi 2023-01-13 14:20:57 -08:00
Anonymous Maarten 0785f272fd Add type argument to non-dynamic LOAD_LIBUSB_SYMBOL macro
It should not need a cast.
2023-01-13 19:31:18 +01:00
Sam Lantinga 67ddb4c5a2 Fixed PS2 build 2023-01-13 10:00:16 -08:00
Francisco Javier Trujillo Mata 40f0744b73 Use filesystem drivers 2023-01-13 09:59:46 -08:00
Frank Praznik 180afcdf39 Revert "wayland: Don't try to restore non-resizable windows"
This reverts commit e35c3872dc.
2023-01-12 17:59:50 -08:00
Sam Lantinga c9647b4ad0 Use the symbolic names of the audio and video driver hints 2023-01-12 17:25:15 -08:00
Sam Lantinga 23beef4fc7 We no longer need explicit SDL_ENABLE_SYSWM_* while building SDL 2023-01-12 16:17:00 -08:00
Sam Lantinga 7516bd349c Move SDL_internal.h to be first in the file, after the copyright 2023-01-12 16:17:00 -08:00
Sam Lantinga 0da24479da Fixed building Vivante video driver 2023-01-12 16:17:00 -08:00
Sam Lantinga 99ec05e2b8 Cast the return value of SDL_LoadFunction() to the type of the function being loaded 2023-01-12 16:17:00 -08:00
Frank Praznik e35c3872dc wayland: Don't try to restore non-resizable windows
Libdecor can crash if attempting to un-maximize a window that was not set as resizable.
2023-01-12 13:34:36 -08:00
Frank Praznik 50f2eb7d41 wayland: Perform a round trip when maximizing and restoring windows
Perform a round trip when maximizing and restoring windows so the changes have already taken effect when the associated functions return.
2023-01-12 13:34:36 -08:00
Sam Lantinga 6dc50a78fc Fixed window never being shown on iOS 2023-01-12 12:45:55 -08:00
happyharryh 57e78f4cf5 Fixed the hat_map to avoid segmentation fault 2023-01-12 06:55:35 -08:00
Sam Lantinga 1bf1c866fe Handle new SDL_rwops error codes in SDL_LoadFile_RW()
Thanks @BeWorld2018!
2023-01-12 06:53:07 -08:00
Ozkan Sezer 2ec9a20204 SDL_dynapi.c: add extern "C" guards, just in case.. 2023-01-12 14:01:32 +03:00
Anonymous Maarten 67d517907b log: fix unused-variable warning when configuring SDL with -DSDL_LIBC=OFF 2023-01-11 16:31:27 -08:00
Francisco Javier Trujillo Mata 7f610cd969 Using UV instead of STQ 2023-01-11 15:10:51 -08:00
Francisco Javier Trujillo Mata 555183257d Remove dummy flag 2023-01-11 15:10:51 -08:00
Ozkan Sezer 30516fd3a6 joystick/vita: add some sanity check to SDL_GetJoystickInstanceID result
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Ozkan Sezer f046788a5a joystick/vita: fix index value use returned by SDL_GetJoystickInstanceID
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Ozkan Sezer 85924687fd fix SDL_GetSensorInstanceID() return code upon failure.
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Ozkan Sezer 0621a67350 fix SDL_GetJoystickInstanceID() return code upon failure
Reference issue: https://github.com/libsdl-org/SDL/issues/7051
2023-01-11 21:56:50 +03:00
Sam Lantinga 21a1508ceb Re-add JNI_OnLoad to the symbols list so Android symbols are resolved properly 2023-01-10 21:15:21 -08:00
Sam Lantinga 237086c917 Fixed Xcode 14.2 warnings 2023-01-10 15:51:14 -08:00
Sam Lantinga dc280c17a0 Moved SDL_intrin.h back into the public headers for application use 2023-01-10 15:50:35 -08:00
Elad Lahav 413af2f5f1 Addressed comments 2023-01-10 06:19:40 -08:00
Elad Lahav 38b35a3414 Allow the use of posix_spawn() instead of vfork/execlp() 2023-01-10 06:19:40 -08:00
Sam Lantinga 56522034db Fixed building with Visual Studio 2010 2023-01-09 18:30:23 -08:00
Narr the Reg 9fa55d9cab hidapi: switch: Add user calibration support 2023-01-09 18:07:54 -08:00
Sam Lantinga 2aa9569b3e Replaced SDL_SIMDAlloc(), SDL_SIMDRealloc(), and SDL_SIMDFree() with SDL_aligned_alloc() and SDL_aligned_free()
Fixes https://github.com/libsdl-org/SDL/issues/5641
2023-01-09 18:01:59 -08:00
Anonymous Maarten aa7fdd6624 haiku: remove unused variable in SDL_BApp.h 2023-01-10 02:39:09 +01:00
Anonymous Maarten f85ef6fc3c haiku: fix use of SDL_ConvertSurfaceFormat 2023-01-10 02:39:09 +01:00
Sam Lantinga e9b86eebf3 Functions which return function pointers now return SDL_FunctionPointer instead of void*
This fixes the clang warning "Cast between pointer-to-function and pointer-to-object is an extension"

You can define SDL_FUNCTION_POINTER_IS_VOID_POINTER in your project to restore the previous behavior.

Fixes https://github.com/libsdl-org/SDL/issues/2866
2023-01-09 15:46:21 -08:00
Sam Lantinga 5feebcdce0 SDL_AddHintCallback() now returns a standard int result instead of void
Fixes https://github.com/libsdl-org/SDL/issues/7035
2023-01-09 12:09:30 -08:00
Sam Lantinga fde78d12f2 Updated copyright for 2023 2023-01-09 09:41:41 -08:00
Sam Lantinga c663e6d568 Revert "Always allow controller events for virtual joysticks regardless of focus state"
This reverts commit d94f2a9ee5.

Rather than changing behavior, we'll set SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS in the joystick tests
2023-01-09 09:05:40 -08:00
Anonymous Maarten f91a747549 include: SDL_dynapi.h depends on platform defines 2023-01-08 21:37:54 +01:00
Sam Lantinga d94f2a9ee5 Always allow controller events for virtual joysticks regardless of focus state
Refrence https://github.com/libsdl-org/SDL/pull/7024
2023-01-08 10:48:46 -08:00
Sam Lantinga ac99db9fc8 Fixed infinite loop shutting down WGI controllers
We are guaranteed that the lock will be held during shutdown, so if we are in InvokeRemoved(), it's because we're shutting down controllers and need to remove them from our internal list.

Fixes https://github.com/libsdl-org/SDL/issues/7016
2023-01-08 09:35:17 -08:00
Anonymous Maarten f53d797cca cmake: generate git hash using GetRevisionDescription CMake module
This allows the build system (ninja/make/VS) to detect whether the current
checkout git commit has changed. If so, SDL_revision.h will be updated.
2023-01-08 18:20:56 +01:00
Hunter Kvalevog 0953367967 SDL_Vulkan_GetInstanceExtensions: Remove window
Remove the unused `window` parameter from
SDL_Vulkan_GetInstanceExtensions, which is never used by any of the
backends.
2023-01-08 07:55:34 -08:00
Anonymous Maarten ec14487e1d unix/SDL_systimer.c: add ';' to statement 2023-01-08 01:04:06 +01:00
Sylvain 13ab100317
Fixed bug #6990: fix computation of alpha in BlitRGBtoRGBPixelAlphaMMX
backport from SDL2 branch
2023-01-06 21:29:01 +01:00
Sylvain 93e2903ac5 Add SDL_PlayAudioDevice() to play audio. Remove pause_on param from SDL_PauseAudioDevice() 2023-01-06 09:15:39 -08:00
Frank Praznik 230ad2a201 wayland: Handle modifier keys internally
Modifier keys on Wayland can be remapped, latched/locked, and defer the system modifier state changes to key release events instead of key press events, which the default SDL modifier handling code doesn't deal with correctly. Track and set the modifier keys internally to deal with the plethora of various combinations that the system key modifiers can be in and correctly reflect the actual system state to SDL applications.
2023-01-05 10:39:19 -08:00
Frank Praznik d2917918c0 events: Add function to send keystrokes and not update the modifier state
Add SDL_SendKeyboardKeyIgnoreModifiers() function and repurpose the source parameter for the SDL_SendKeyboardKeyInternal() function to use as a generic set of keyboard flags.
2023-01-05 10:39:19 -08:00
Matt Durgavich 59ad6793b9
Fix For issue #6948 (#6991)
MessageBoxes attached to a window in macOS should use modal APIs and not
use a poll/sleep pattern on the main thread. Sleeping the main thread
makes the NSWindow message loop sluggish and interferes with external
applications that need to send messages to that window, such as
VoiceOver.
2023-01-05 08:54:27 -08:00
Sylvain 2d7f8d7d51 Remove legacy SDL_Audio functions that acts on device id == 1 2023-01-05 09:40:06 -05:00
Guldoman 5a42831345 wayland: Fallback to default cursor if chosen one wasn't found 2023-01-04 21:28:26 -08:00
Sam Lantinga 0bbf6cc379 Test text rendering APIs take floating point coordinates 2023-01-04 16:45:02 -08:00
Sam Lantinga 4f978456a8 Renamed SDL_GAMEPADDEVICEREMAPPED to SDL_GAMEPADREMAPPED 2023-01-04 14:32:37 -08:00
Deve eddaf870f5 Avoid textinput events when pasting from clipboard on iOS.
I handle command+C and command+V shortcuts for copy/paste from clipboard using
SDL_GetClipboardText/SDL_SetClipboardText. But on iOS command+V shortcut is
also handled by system, so that I also get textinput event with that clipboard
text. And thus the application gets this clipboard text twice (from
SDL_GetClipboardText and from textinput event).

I assume that intended behavior is that command+V shouldn't generate textinput
events. At least as far as I know ctrl+V on other platforms does nothing. This
commit disables paste action for UITextField, so that textinput event isn't
generated anymore.
2023-01-04 13:52:15 -08:00
Sam Lantinga c823f26f18 Revert "Removed public joystick locking API"
This reverts commit a515f51ac0.

We still need joystick locking to protect the gamepad mappings
2023-01-04 13:51:40 -08:00
Sylvain 6863f0b2d8 Add SDL_WindowID type for SDL_Window id 2023-01-04 09:21:52 -08:00
Sam Lantinga 86c6376140 Fixed integral constant overflow 2023-01-04 08:54:46 -08:00
Sam Lantinga aaaf7423ac Fixed build 2023-01-03 16:17:10 -08:00
Sam Lantinga 32c077216c Fixed warnings 2023-01-03 15:59:35 -08:00
Sam Lantinga 49af0d1b89 Fixed build 2023-01-03 15:35:18 -08:00
Sam Lantinga e85839cd56 Fixed line wrapping for HID packet dump 2023-01-03 15:12:47 -08:00
Sam Lantinga dacdb1c310 Added support for the ThrustMaster eSwap PRO Controller Xbox 2023-01-03 15:12:18 -08:00
Sylvain 86658f2ca7 Wayland / Drag and Drop: find the current window 2023-01-03 08:18:08 -08:00
Sam Lantinga 9c1a9ecb4b Removed non-float versions of SDL render API drawing functions
This simplifies the API and removes a level of API translation between the int variants of the functions and the float implementation

Fixes https://github.com/libsdl-org/SDL/issues/6656
2023-01-03 08:16:58 -08:00
Sylvain bf76fc6b05 Fixed bug #6816 - SDL_RenderSetVSync doesn't disable vsync for software renderer 2023-01-03 06:38:11 -08:00
Sam Lantinga 38b138cd0a Fixed rounding of floating point values in snprintf 2023-01-03 06:35:25 -08:00
Sam Lantinga 72f0056961 Simulate NTSC timings for Windows desktop display modes 2023-01-03 06:35:25 -08:00
Sam Lantinga e3c1749f5b The refresh rate in SDL_DisplayMode is now a float 2023-01-03 06:35:25 -08:00
Sylvain Becker 851b0e16be
Add SDL_GetRenderVSync (see #6495) (#6965) 2023-01-02 11:21:02 -08:00
Sylvain Becker 023f067903
Update GL_GetSwapInterval for backends (#6963) 2023-01-02 10:15:05 -08:00
Mathieu Eyraud fa5475ba9f Fix joystick instance id check 2023-01-02 09:04:18 -08:00
Mathieu Eyraud ea6f0ae683 Fix use after free in SDL_GetGamepads 2023-01-02 09:03:49 -08:00
Mathieu Eyraud 721ece7ba0
Fix memory leak in SDL_SW_CreateYUVTexture 2023-01-02 10:22:44 +01:00
Sylvain Becker 8a13533949
Handle error return value for SDL_GetSwapInterval 2023-01-01 08:20:41 -08:00
Sam Lantinga a515f51ac0 Removed public joystick locking API
All joystick functions are thread-safe and you can now get an atomic list of joysticks with SDL_GetJoysticks()

Fixes https://github.com/libsdl-org/SDL/issues/6956
2022-12-31 09:24:14 -08:00
Ozkan Sezer 321c30db57 windows: more HANDLE -> HMODULE changes. 2022-12-31 08:00:00 +03:00
Ozkan Sezer 929da2c28e SDL_dynapi.c: LoadLibraryA() returns HMODULE. 2022-12-30 11:11:10 +03:00
Sam Lantinga 324c0b76a0 Removed SDL_HasGamepads(), SDL_HasJoysticks(), and SDL_HasSensors()
Also cleaned up logic for whether we need to poll for events:
- We need to periodically poll for joysticks to handle hotplug.
- We need to frequently poll for joysticks and sensors when they're open so their state can be updated
2022-12-29 23:20:26 -08:00
Sam Lantinga 7f23d71b6a Added SDL_modf() and SDL_modff()
This function is useful for accumulating relative mouse motion if you want to only handle whole pixel movement.
e.g.
static float dx_frac, dy_frac;
float dx, dy;

/* Accumulate new motion with previous sub-pixel motion */
dx = event.motion.xrel + dx_frac;
dy = event.motion.yrel + dy_frac;

/* Split the integral and fractional motion, dx and dy will contain whole pixel deltas */
dx_frac = SDL_modff(dx, &dx);
dy_frac = SDL_modff(dy, &dy);
if (dx != 0.0f || dy != 0.0f) {
    ...
}
2022-12-29 23:12:19 -08:00
Sam Lantinga ead4f122e4 Added basic support for %g snprintf format specifier 2022-12-29 23:12:19 -08:00
Sam Lantinga cefbeb582f Mouse coordinates are floating point
You can get sub-pixel mouse coordinates and motion depending on the platform and display scaling.

Fixes https://github.com/libsdl-org/SDL/issues/2999
2022-12-29 23:12:19 -08:00
Sam Lantinga 98678b5d8d SDL API renaming: SDL_Alloc*/SDL_Free* -> SDL_Create*/SDL_Destroy*
Fixes https://github.com/libsdl-org/SDL/issues/6945
2022-12-29 15:07:15 -08:00
Sam Lantinga e1bd5bd071 Fixed keyboard scancode mapping for parenthesis
(thanks to @meyraud705 for tracking down the root cause!)

Fixes https://github.com/libsdl-org/SDL/issues/6787
Closes https://github.com/libsdl-org/SDL/pull/6937
2022-12-29 14:55:18 -08:00
Sam Lantinga 1b90107fdb Spell out "Float" in function names 2022-12-29 14:50:31 -08:00
Sylvain Becker d7d3c22dbf
Remove more reserved identifiers (#6925) 2022-12-29 13:58:16 -08:00
Sylvain 88630b85f5 SDL_GL_SwapWindow() returns an error code 2022-12-29 08:40:51 -08:00
Sam Lantinga abd051f89e Re-sorted SDL 3.0 API list 2022-12-28 19:55:19 -08:00
Sam Lantinga 80890f3aae SDL API renaming: SDL_render.h
Fixes https://github.com/libsdl-org/SDL/issues/6883
2022-12-28 19:40:25 -08:00
Sam Lantinga ea0c2f55be SDL API renaming: *Is* functions
Feedback from @icculus:
"IsTablet" uses "is" as a form of "to be" ...like, the actual question is of its nature.

The rest is just a superfluous word in the question and it flows as better English with if (RectEmpty) than if (IsRectEmpty)

Fixes https://github.com/libsdl-org/SDL/issues/6932
2022-12-28 19:40:25 -08:00
Sam Lantinga 66351fd4ba Replace tri-state functions SDL_EventState(), SDL_GetJoystickEventState(), SDL_GetGamepadEventState(), SDL_ShowCursor()
`SDL_QUERY`, `SDL_IGNORE`, `SDL_ENABLE`, and `SDL_DISABLE` have been removed.

SDL_EventState() has been replaced with SDL_SetEventEnabled()
SDL_GetEventState() has been replaced with SDL_EventEnabled()
SDL_GameControllerEventState has been replaced with SDL_SetGamepadEventsEnabled() and SDL_GamepadEventsEnabled()
SDL_JoystickEventState has been replaced with SDL_SetJoystickEventsEnabled() and SDL_JoystickEventsEnabled()

SDL_ShowCursor() has been split into three functions: SDL_ShowCursor(), SDL_HideCursor(), and SDL_CursorVisible()

Fixes https://github.com/libsdl-org/SDL/issues/6929
2022-12-28 17:49:34 -08:00
Sam Lantinga 61232de1ab Sort the initial SDL 3.0 symbols 2022-12-28 14:29:03 -08:00
Sylvain 71eb78e790
X11: fix removing SDL_WINDOW_HIDDEN flags (thanks @zturtleman) 2022-12-28 23:18:00 +01:00
Sam Lantinga e4e7a8baff Reset the dynamic API for SDL 3.0 2022-12-28 13:53:06 -08:00
Sam Lantinga 16092f58bb Updated gamepad, joystick, sensor APIs, removing device indices
Instead of indexing into an internal list of devices which requires locking, we return a list of device IDs which can then be queried individually.

Reference: https://github.com/libsdl-org/SDL/issues/6889
2022-12-28 13:10:27 -08:00
Sam Lantinga e40a96155f Fixed getting the VID/PID of a virtual joystick 2022-12-28 12:51:54 -08:00
Sylvain aa46ff8f4b Remove SDL_WINDOW_SHOW flag, as redundant with SDL_WINDOW_HIDDEN 2022-12-28 12:16:57 -08:00
Zack Middleton e512809246 Fixup PS2/PSP SDL_RunApp()
Make PS2/PSP use the mainFunction argument for SDL_RunApp().

Make PSP SDL_RunApp() return the value from mainFunction().

Make PS2 SDL_RunApp() call SDL_SetMainReady() like all other
SDL_RunApp() functions. (It doesn't affect anything for PS2 as
SDL_MAIN_NEEDED isn't defined.)
2022-12-28 05:57:10 -08:00
Sam Lantinga 36d4395c97 SDL API renaming: internal functions 2022-12-27 15:05:51 -08:00
Sylvain 25336d053a Remove underscore for _SDL_iconv_t
And change the name, not to have the same for pointer and data
2022-12-27 12:41:09 -08:00
Sylvain Becker 07808d6a03
Remove underscore in guard header defines (#6922) 2022-12-27 12:31:12 -08:00
Sam Lantinga 3db9112ef4 Make sure we match the same way when adding a mapping and looking up a mapping
Fixes https://github.com/libsdl-org/SDL/issues/6898
2022-12-27 12:16:46 -08:00
Sylvain 81cd84f456 Remove reserved underscore SDL_joystick 2022-12-27 11:34:13 -08:00
Sam Lantinga ab2d007982 More gamepad renaming 2022-12-27 11:31:54 -08:00
Sam Lantinga 58aecf0a54 SDL API renaming: SDL_rect.h
Fixes https://github.com/libsdl-org/SDL/issues/6887
2022-12-27 11:01:11 -08:00
Sam Lantinga a28d1d59be More gamepad renaming 2022-12-27 10:42:45 -08:00
Sam Lantinga 701e965235 Removed leading underscore in structure names
Fixes https://github.com/libsdl-org/SDL/issues/6856
Closes https://github.com/libsdl-org/SDL/pull/6914
Closes https://github.com/libsdl-org/SDL/pull/6915
Closes https://github.com/libsdl-org/SDL/pull/6916
Closes https://github.com/libsdl-org/SDL/pull/6917
Closes https://github.com/libsdl-org/SDL/pull/6918
Closes https://github.com/libsdl-org/SDL/pull/6919
2022-12-27 10:35:53 -08:00
Sam Lantinga 960e9044b3 Fixed test code after gamepad event rename 2022-12-27 10:28:43 -08:00
Sam Lantinga ad8a6d2b05 Split SDL gamepad internal functions into SDL_gamepad_c.h 2022-12-27 10:23:28 -08:00
Sam Lantinga 659abc721a SDL API renaming: SDL_gamecontroller.h
SDL_gamecontroller.h has been renamed SDL_gamepad.h, and all APIs have been renamed to match.

Fixes https://github.com/libsdl-org/SDL/issues/6885
2022-12-27 09:47:24 -08:00
Sam Lantinga c6969df4d7 SDL API renaming: SDL_video.h
Fixes https://github.com/libsdl-org/SDL/issues/6880
2022-12-27 06:38:34 -08:00
Sam Lantinga cc0296c934 SDL API renaming: SDL_surface.h
Fixes https://github.com/libsdl-org/SDL/issues/6884
2022-12-27 06:36:39 -08:00