Commit Graph

8442 Commits

Author SHA1 Message Date
Ryan C. Gordon 983f178b7d
render: Clip lines before Bresenham algorithm generates points.
Otherwise, a massive line might generate gigabytes worth of points to render,
which the backend would simply throw away anyhow.

Fixes #8113.

(cherry picked from commit 4339647d90)
2023-11-24 19:34:47 -05:00
Ryan C. Gordon db7f6425d0
rect: Avoid numeric overflow on massive lines in SDL_IntersectRectAndLine.
Reference Issue #8301.
Reference Issue #8113.

(cherry picked from commit a391dd5fef)
2023-11-24 19:34:20 -05:00
Ryan C. Gordon 6ba90f7775 render: Batching is always enabled now!
Make sure your app uses SDL_RenderFlush() before it talks to D3D/OpenGL/etc!

Fixes #8584.
2023-11-23 20:37:52 -05:00
Ryan C. Gordon b24d6bd59a
opengl: Creating a texture trashes the cached `texturing` state, fix it.
Reference Issue #7194.

(cherry picked from commit e9b4869372)
2023-11-23 20:01:02 -05:00
Ryan C. Gordon dcf04559db
render: GL-based renderers should treat adaptive vsync as vsync being enabled.
Fixes #8004.
2023-11-23 18:28:43 -05:00
Ryan C. Gordon 74a2542564
x11: Deal with difference in GLX_EXT_swap_control_tear behavior.
Mesa and Nvidia handle it differently, and one or the other may fix their
implementation in the future, so test which way it works at runtime.

Reference Issue #8004.
2023-11-23 13:56:51 -05:00
Ozkan Sezer 08fac5b1b2 SDL_PenModifyForWacomID: return zero as axis_flags upon failure.
Fixes uninitialized warning in testautomation_pen.c:
testautomation_pen.c:1512: warning: 'mask' may be used uninitialized in this function
2023-11-23 11:56:50 +03:00
Ozkan Sezer aaba01aee4 hidapi: syncing with mainstream:
- macos, pthread_barrier_wait: properly check the wait condition
- windows: Assert that struct has the correct size
- windows: Fix printf/string-related issues
- other miscellaneous stuff irrelevant in SDL. (for symmetry...)
2023-11-23 11:35:02 +03:00
Ozkan Sezer 5730eb67f0 add HAVE_GCC_DIAGNOSTIC_PRAGMA to SDL_internal.h, use it 2023-11-23 11:33:20 +03:00
Ozkan Sezer 42c8366fdc revise iconv detection:
- check libiconv with a linkage test with iconv.h included
- check libc iconv with a linkage test with iconv.h included
  and LIBICONV_PLUG defined (in case libiconv header is in
  include path)
- add new configuration option to prefer iconv from libiconv,
  if available, over the libc version: SDL_LIBICONV, defaults
  to disabled.
- remove FindIconv + pkg_check_modules for iconv, and use our
  manual iconv finding only
- change FreeBSD specific LIBICONV_PLUG define in SDL_iconv.c
  to configuration result.
2023-11-23 04:30:56 +03:00
Ozkan Sezer 53544cabaa psp: fix copy/paste error from SDL2 in PSP_VideoQuit(). 2023-11-23 04:11:24 +03:00
Ryan C. Gordon 6cde96f9a0
psp: Hook up event subsystem init/quit.
Fixes #8554.

(cherry picked from commit 0e9d050296)
2023-11-22 18:03:29 -05:00
Ryan C. Gordon e9659f5738
Removed some function declarations that don't actually exist.
Reference Issue #8554.

(cherry picked from commit 87875a49b4)
2023-11-22 17:58:54 -05:00
Ryan C. Gordon 3264e64738
SDL_RunApp: Make sure argc/argv are stable if the caller didn't define them.
Fixes #8246.
2023-11-22 17:34:39 -05:00
Sam Lantinga 81fc7ded78 Removed the window shape API for SDL 3.0
Fixes https://github.com/libsdl-org/SDL/issues/6654
Fixes https://github.com/libsdl-org/SDL/issues/6897
2023-11-22 14:11:10 -08:00
Sam Lantinga 45938bbfa5 Corrected comment 2023-11-22 10:35:15 -08:00
zoeyjodon 059e550e98
Fix 3DS Analog Values (#8581) 2023-11-22 10:34:01 -08:00
zoey jodon dbf14df80f Fix joysticks returning invalid device IDs 2023-11-22 10:33:11 -08:00
Anonymous Maarten f26a93211f SDL_bsdjoystick: fix -Wundef warning on FreeBSD 2023-11-22 06:23:00 +03:00
Ozkan Sezer 86d77bbcc5 kmsdrm: restrict KMSDRM_ReleaseVT/KMSDRM_AcquireVT to SDL_INPUT_LINUXEV 2023-11-22 06:21:28 +03:00
Ozkan Sezer 94ad1a4ae4 SDL_bsdjoystick.c: fix -Wundef warning. 2023-11-22 06:21:28 +03:00
Sam Lantinga e761770c24 No, this wasn't right 2023-11-21 15:26:53 -08:00
Sam Lantinga b7d7e54895 Fixed uninitialized variable 2023-11-21 15:26:34 -08:00
Sam Lantinga 119e02f314 Always use 'm' for controllers provided by the MFI joystick driver
This makes sure that SDL_JoystickGUIDUsesVersion() returns false and we don't try to match against other similar controllers using old mappings.
2023-11-21 15:19:23 -08:00
Sam Lantinga 75df4cc5c2 Don't tickle PS4 Bluetooth controllers in simple mode
The 8BitDo Zero 2 only sends reports when state changes, so trips the disconnected Bluetooth controller detection. The expected use case is that most people will have official PS4 controllers in enhanced report mode, so disconnected Bluetooth controller detection will still work for those.

Fixes https://github.com/libsdl-org/SDL/issues/8556
2023-11-21 13:25:02 -08:00
Dimitriy Ryazantcev 0d431015bf Extract BMP magic into separate define 2023-11-21 08:37:33 -08:00
Dimitriy Ryazantcev 0413f6fc49
Use SDL_iscntrl() call instead of manual code that is doing the same (#8593) 2023-11-21 08:36:32 -08:00
Zack Middleton fd91178d7f Make size cursors be double arrows on Wayland
I added fallbacks as they are listed under "to be discussed" in the spec
but I don't know if they're necessary.

https://www.freedesktop.org/wiki/Specifications/cursor-spec/
2023-11-21 08:34:30 -08:00
Zack Middleton 5e9b0820f3 Add cursors for X11/Wayland window resizing 2023-11-21 08:34:13 -08:00
Dimitriy Ryazantcev 91e122316c Use SDL_small_alloc() instead of SDL_stack_alloc() in CreateMaskBitmap() 2023-11-21 07:42:01 -08:00
Ionuț Leonte b76f8de298
Hit testing tweaks for X11 and Wayland (#8582)
Hit testing on X11 and Wayland should now behave more like it
does on Windows - the current active zone is tracked on mouse
motion events and the cursor is changed accordingly when hovering
a "special" zone (such as the resize handles).
2023-11-20 13:33:11 -08:00
Dimitriy Ryazantcev 49d58bc73a Cleanup WIN_CreateCursor() code a bit
Generate bimap mask from the alpha channel.
2023-11-19 12:41:12 -08:00
Frank Praznik 4722269fb6 tests: Print window occluded log events 2023-11-18 10:50:39 -05:00
Cameron Cawley 5db781cc3d Use the correct pixel formats for OpenGL ES on big endian 2023-11-17 15:02:44 -08:00
Cameron Cawley 05e7dcf8f8 Support returning <8bpp surfaces in SDL_LoadBMP_RW 2023-11-17 08:45:32 -08:00
Cameron Cawley 773ec1cfcb Extend blitting support for all <8bpp formats 2023-11-17 08:45:32 -08:00
Cameron Cawley 753bbd199e Add SDL_PIXELFORMAT_INDEX2LSB and SDL_PIXELFORMAT_INDEX2MSB 2023-11-17 08:45:32 -08:00
Ozkan Sezer 39870031d1 use format string attributes for functions accepting va_list params, too 2023-11-17 15:56:10 +03:00
Sam Lantinga 666301f9f9 Fixed build with older macOS SDK 2023-11-16 21:01:28 -08:00
Sam Lantinga 238987df3b Always use physicalInputProfile on OS versions that support it
Also cleaned up @available warnings in the GCController support
2023-11-16 16:08:53 -08:00
Sam Lantinga e424dcca4b More fixing the build with older macOS SDKs 2023-11-16 12:04:45 -08:00
Sam Lantinga 4ebb0c6dac Revert "Fixed build"
This reverts commit 7abacc9f9f.
2023-11-16 12:03:39 -08:00
Sam Lantinga 7abacc9f9f Fixed build 2023-11-16 11:44:59 -08:00
Sam Lantinga ac1f896f89 Fixed building with older macOS SDK 2023-11-16 10:49:13 -08:00
Sam Lantinga 8043dad369 Fixed build warning 2023-11-16 10:28:54 -08:00
Sam Lantinga f61c0f3dc1 SDL_HINT_TV_REMOTE_AS_JOYSTICK should only affect Siri Remotes on Apple TV
Other gamepads like the iBuffalo Classic USB Gamepad will not have a standard profile, but shouldn't be ignored when this hint is enabled.
2023-11-16 09:19:27 -08:00
Sam Lantinga 51fc134cad Added support for the second generation Siri Remote on Apple TV 2023-11-16 09:07:29 -08:00
Sam Lantinga bfba9de43a Revert "Map Siri Remote touchpad to D-Pad for consistency with physicalInputProfile mapping"
This reverts commit 2999634f29.

The physicalInputProfile mapping maps the touchpad to left thumbstick now, as the 2nd generation Siri Remote has both touchpad and cardinal direction D-Pad functionality
2023-11-16 09:07:29 -08:00
Sam Lantinga 57e5c7f6ee We'll just use the legacy names for face buttons in the mappings
This fixes being able to accidentally rebind the face buttons in testcontroller
2023-11-15 22:09:09 -08:00
Sam Lantinga fb08c22abf Disable controller state debug messages 2023-11-15 21:46:45 -08:00