Commit Graph
100 Commits
Author SHA1 Message Date
Ryan C. Gordon 3766a39409 emscripten: double the audio buffer size.
Some systems seem to not keep up with the smaller buffer.

Reference Issue #11930.
2025-01-13 16:26:18 -05:00
Ryan C. Gordon 2b8fb0bdd4 wikiheaders: Maybe fix perl warning.
Reference Issue #11944.
2025-01-13 15:18:39 -05:00
Ryan C. Gordon 4bddf521dd emscripten: Override emscripten's fullscreen button with SDL's implementation.
Fixes #6798.
Fixes #7913.
Fixes #9044.
2025-01-13 14:17:36 -05:00
Ryan C. Gordon 307e6f2ca6 emscripten: simulate mouse autocapture.
This is just enough to delay MOUSE_LEAVE events until a drag ending outside
the canvas is released, and make sure the MOUSE_UP event has the canvas's
SDL_WindowID, which it wouldn't when mouse focus is was lost by this point.

Fixes #10033.
2025-01-13 02:39:39 -05:00
Ryan C. Gordon 95c1584386 README-migration: note SDL2 brightness/gamma ramp APIs that have been removed.
Fixes #11918.
2025-01-12 04:35:56 -05:00
Ryan C. Gordon f0af6c348a emscripten: Add SDL_EVENT_DISPLAY_ORIENTATION support.
Reference Issue #11389.
2025-01-12 02:23:00 -05:00
Ryan C. Gordon 3ad9c38a46 emscripten: Don't set OpenGL swap intervals until first PumpEvents.
Any requested swap interval will be saved and set on the first PumpEvents.
Once PumpEvents has been called at least once, swap intervals are set
immediately.

This assumes that events won't be pumped until after an Emscripten main loop
has been defined, and so prevents a warning on the javascript console:

"emscripten_set_main_loop_timing: Cannot set timing mode for main loop since
a main loop does not exist! Call emscripten_set_main_loop first to set one
up."

Fixes #9969.
2025-01-11 15:19:09 -05:00
Ryan C. Gordon 82125ec1d8 x11: Be more aggressive about finding _any_ usable messagebox font.
Fixes #4800.
Fixes #11910.
2025-01-11 00:35:39 -05:00
Ryan C. Gordon fb0f6a1196 cocoa: Display mode changes set Desktop display mode, not current. 2025-01-10 15:35:43 -05:00
Ryan C. Gordon 38176bfe9a cocoa: Implemented display hotplugging support.
Fixes #7764.
2025-01-10 13:25:34 -05:00
Ryan C. Gordon fb94a79f89 stdinc: define SDL_NOLONGLONG for old Visual Studios, document the symbol.
Reference PR #11900.
2025-01-10 01:37:25 -05:00
Ryan C. Gordon 507593f485 wikiheaders: Allow symbols to be filtered from manpage generation by regex.
This is specifically to prevent generating a manpage for "Uint32" and friends.

Fixes #11898.
2025-01-09 14:13:00 -05:00
Ryan C. Gordon 3f7f632e14 audio: Added SDL_AudioDeviceStreamPaused.
We had the other two wrapper functions to pause and resume, and forgot query.
2025-01-09 01:36:57 -05:00
Ryan C. Gordon f61860fa93 testautomation: fixed incorrect test.
The test was doing this:

- The output size is 80x60
- The logical size is 40x30
- The viewport is { 10, 7, 40, 30 }
- Draw to fill this whole viewport.

This would offset the filled rectangle a little, as before, but then the
viewport was the size of the entire logical space, so it wasn't a rectangle
centered in the middle of the output, as was expected.

This used to produce the expected output before the fix in
fa7a529912. But it appears the test was
incorrect, so this tweaks the viewport to produce the expected result.
2025-01-08 23:33:39 -05:00
Ryan C. Gordon 4bb3c2a1c7 render: Some cleanups.
Mostly setting NULL pointers to a local struct instead of copying non-NULL
pointers' contents into the local struct.
2025-01-08 14:59:28 -05:00
Ryan C. Gordon 61bdbacdae render: SDL_RenderTextureTiled shouldn't try to drop draw calls, either. 2025-01-08 14:59:28 -05:00
Ryan C. Gordon f044a3d6ca Revert "render: GetRenderViewportSize shouldn't use scale, just logical presentation."
This reverts commit ef758d05c1.

Turns out the bug in #11076 was that we were dropping texture draws
incorrectly, not that scale shouldn't be applied here. The dropped draw calls
were fixed in bf85320947, and this revert is
making the renderer consistent again.
2025-01-08 14:59:27 -05:00
Ryan C. Gordon fa7a529912 render: GetRenderViewportSize shouldn't scale viewport dimensions.
These are already scaled for the logical presentation (unless using the pixel
dimensions instead; we still scale those here).

Fixes #11704.
2025-01-08 14:59:27 -05:00
Ryan C. Gordon bf85320947 render: Don't try to drop draws outside of the viewport.
It didn't take scale into account, and the backends would need to do clipping
anyhow, so let the system figure that out for us at the lower level.

Fixes #11318.
2025-01-08 11:55:10 -05:00
Ryan C. Gordon 6934c910b3 opengl: use GL_UNSIGNED_BYTE instead of GL_UNSIGNED_INT_8_8_8_8_REV.
This seems to be significantly more efficient on some modern platforms, but if
this turns out to be a widespread disaster, we can revert it.
2025-01-07 16:08:56 -05:00
Ryan C. Gordon 0180ca541e windows: Catch WM_POINTERCAPTURECHANGED events.
Fixes #11844.
2025-01-07 10:22:15 -05:00
Ryan C. Gordon b674b715f5 fix integer overflow ub in testautomation_sdltest
(cherry-picked from commit f804293a27)
2025-01-06 13:18:03 -05:00
Ryan C. Gordon 1e1442ed4a README-migration.md: Note the GL/EGL library environment variable removals. 2025-01-06 13:12:31 -05:00
Ryan C. Gordon d8c7006a42 README-migration.md: Removed obsolete documentation.
Fixes #11434.
2025-01-06 13:07:21 -05:00
Ryan C. Gordon 6473de59b7 SDL_keyboard.h: Note that SDL_GetKeyName() returns uppercase letters.
Reference Issue #11434.
2025-01-06 12:47:44 -05:00
Ryan C. Gordon 1f54b228ff video: Convert some EGL environment variables to SDL hints.
Fixes #10479.
2025-01-06 11:15:26 -05:00
Ryan C. Gordon d16f76e3d4 wasapi: Don't crash/hang if transitioning to/from a Remote Desktop Connection.
Fixes #9673.
2025-01-05 21:53:35 -05:00
Ryan C. Gordon 742f2a2fad SDL_render.h: Improve SDL_ConvertEventToRenderCoordinates documentation.
Fixes #9424.
2025-01-05 20:55:42 -05:00
Ryan C. Gordon 7f9ee31024 include: Fill in more category documentation.
Reference Issue #11874.
2025-01-05 14:11:11 -05:00
Ryan C. Gordon 6a0405b933 testautomation: Added a test to stdlib_swprintf that previously would fail. 2025-01-05 02:45:15 -05:00
Ryan C. Gordon 181995b44f stdlib: Reworked SDL_vswprintf to be more efficient and return correct values.
Fixes #11729.
2025-01-04 21:55:07 -05:00
Ryan C. Gordon 344e394bf4 camera: Favor v4l2 over pipewire, for now.
Reference Issue #11473.
Reference Issue #9776.
Reference Issue #11819.
Reference Issue #9989.
Reference Issue #10842.
2025-01-04 16:11:57 -05:00
Ryan C. Gordon 3519ef3b3b SDL_asyncio.h: Fixed various datatype's \since documentation. 2025-01-04 04:10:15 -05:00
Ryan C. Gordon 56d7cc7a02 SDL_video.h: Added a note about platform quirks to SDL_DestroyWindow docs.
Fixes #10081.
2025-01-04 03:48:10 -05:00
Ryan C. Gordon 18c6958cae SDL_vulkan.h: Improve SDL_Vulkan_LoadLibrary/SDL_Vulkan_UnloadLibrary docs.
Fixes #9541.
2025-01-04 03:22:34 -05:00
Ryan C. Gordon 2d37903323 pen: implement pen support for Windows.
Fixes #10516.
2025-01-03 12:58:49 -05:00
Ryan C. Gordon e484182765 testcamera: Log the camera backend in use. 2025-01-03 03:46:22 -05:00
Ryan C. Gordon fa9c3331d5 main: Adjust how SDL_HINT_MAIN_CALLBACK_RATE works.
Now (only in the generic backend, where it is implemented), this hint is
always respected. Previously it would only be used if no windows were created,
to help reduce CPU load on things like loopwave.

Since it's always used now, the default has changed from 60 (Hz) to 0 (run as
fast as possible). Things like loopwave should still likely force this way
lower than the previous default (and already do: loopwave explicitly sets it
to 5).

The hint can now also be set to "waitevent" which will cause SDL_AppIterate
to only be called after new events have arrived, for apps that are entirely
driven by input and want to consume (almost) no power or CPU time until then.

Fixes #11093.
Fixes #11387.
2024-12-31 08:19:38 -08:00
Ryan C. Gordon c030e6f782 examples/pen/01-drawing-lines: Match render target size to renderer output.
Otherwise, on HiDPI displays (like a retina iPad), the lines you draw don't
match where the pen is touching.
2024-12-28 15:36:02 -05:00
Ryan C. Gordon 0ad3a18937 uikit: reworked Apple Pencil code.
This manages axes correctly across events, sorts out the math to convert from
Apple's data to what SDL expects, and a few other tweaks and corrections.
2024-12-28 15:36:02 -05:00
Ryan C. Gordon f6143da617 uikit: Patched to compile, added to Xcode project. 2024-12-28 15:36:02 -05:00
Ryan C. Gordon e3c99e3bd3 misc: Fixed typo in iOS error message.
(cherry picked from commit 96b4535cc7)
2024-12-26 23:37:16 -05:00
Ryan C. Gordon 7bbe6025be misc: Make SDL_OpenURL work with VisionOS, tvOS, etc. 2024-12-26 16:50:52 -08:00
Ryan C. Gordon ffed1c50c0 misc: Fix SDL_OpenURL on newer iOS releases.
Apparently as of iOS 18.2, the deprecated API we were using just refuses to
work at all.

Fixes #11728.
2024-12-26 16:50:52 -08:00
Ryan C. Gordon 8fde28813e SDL_tray.h: Filled in doxygen for a few minor missing things. 2024-12-26 14:10:53 -05:00
Ryan C. Gordon f0fad41f2c include: Filled in all remaining missing documentation! 2024-12-22 01:58:13 -05:00
Ryan C. Gordon 819e1cc95b SDL_stdinc.h: A couple wikiheaders fixes. 2024-12-20 02:45:04 -05:00
Ryan C. Gordon b2eb23a617 SDL_filesystem.h: Fill in missing documentation. 2024-12-20 02:39:28 -05:00
Ryan C. Gordon 0b401137d2 SDL_stdinc.h: Document more stuff.
There's only a handful of C runtime wrappers left in this header now!
2024-12-20 02:28:34 -05:00
Ryan C. Gordon b83dd793fd SDL_stdinc.h: Tons of documentation updates.
Almost everything in this header is now documented! The remaining gaps are
literal C runtime wrappers like SDL_strdup, and the analyzer macros like
SDL_INOUT_Z_CAP.
2024-12-20 01:09:40 -05:00
Ryan C. Gordon ff366fba87 include: Move SDL_HAS_BUILTIN to SDL_begin_code.h, document it.
This macro fits better here, since most of the other macros in this file are
for testing similar compiler/target features, etc.
2024-12-19 19:12:56 -05:00
Ryan C. Gordon 401c8f8e4e SDL_timer.h: Fixed doxygen typo. 2024-12-19 16:46:42 -05:00
Ryan C. Gordon 0c42891826 include: Filled in more documentation gaps. 2024-12-19 16:42:14 -05:00
Ryan C. Gordon 624a4d5f26 include: Documented important SDL_begin_code symbols. 2024-12-19 12:19:46 -05:00
Ryan C. Gordon 4d4a2786bb render: Updates to format-string versions of SDL_RenderDebugText.
- Removes SDL_RenderDebugTextV
- Changes SDL_RenderDebugTextF to SDL_RenderDebugTextFormat and tweaks it to
  work in a world without SDL_RenderDebugTextV.
- Tweaked rendering position of formatted text in the example program.
2024-12-18 10:40:31 -05:00
Ryan C. Gordon e957840d34 include: Filling in some more documentation gaps. 2024-12-18 01:18:40 -05:00
Ryan C. Gordon b58e6d7274 .wikiheaders-options: Include CPU intrinsics macros in quick reference. 2024-12-17 23:37:28 -05:00
Ryan C. Gordon c9ab8ad8d9 SDL_intrin.h: Added missing NEON and Altivec documentation. 2024-12-17 23:33:05 -05:00
Ryan C. Gordon 6730cf7bed SDL_intrin.h: Add documentation. 2024-12-17 23:25:25 -05:00
Ryan C. Gordon 2f68efda83 wikiheaders: Add underscore to the "big ascii" character table. 2024-12-17 23:23:13 -05:00
Ryan C. Gordon d0d1414836 messagebox: Copy title and message up front, to protect SDL_GetError() strings.
It's possible (likely!) someone could just pass a pointer returned by
SDL_GetError for one of these strings, but the message box code has to do a
ton of complicated stuff that might _also_ call SDL_SetError, so you could
end up with the string having different contents by the time you display it.

Just make a copy of the strings unconditionally at the start, so they're safe
no matter where they came from.

Fixes #10932.
2024-12-16 21:58:05 -05:00
Ryan C. Gordon 0bb42cb023 alsa: a few more minor formatting tweaks. 2024-12-16 12:19:48 -05:00
Ryan C. Gordon 483ceb5355 alsa: Reenable SDL's internal channel map support when ALSA can't swizzle. 2024-12-16 12:19:48 -05:00
Ryan C. Gordon 35360ec4d7 alsa: Use more hints for opening default devices. 2024-12-16 12:19:48 -05:00
Ryan C. Gordon 576f13ac7c alsa: Put debug logging back into correct category and logging level. 2024-12-16 12:19:48 -05:00
Ryan C. Gordon ff96c59df4 alsa: Add back in code to guess the correct ALSA device prefix. 2024-12-16 12:19:48 -05:00
Ryan C. Gordon b108b54c6a alsa: Bring up to current SDL coding conventions and standards, other tweaks. 2024-12-16 12:19:48 -05:00
Ryan C. Gordon 639855b7e5 alsa: Remove direct calls to memset 2024-12-16 12:19:48 -05:00
Ryan C. Gordon a4a1dff219 alsa: remove loop macro 2024-12-16 12:19:48 -05:00
Ryan C. Gordon b9c062c858 alsa: Pulled in latest changes from @sylware 2024-12-16 12:19:48 -05:00
Ryan C. Gordon 79316ca36e Heavy work on improving category documentation.
Still more to go!

Reference Issue #9440.
2024-12-16 01:10:37 -05:00
Ryan C. Gordon c0803f7683 SDL_dialog.h: Improvements and fixes to the documentation. 2024-12-16 00:02:50 -05:00
Ryan C. Gordon a55686ce61 hints: Clarify when joystick hints should be set.
Fixes #9490.
2024-12-15 21:28:28 -05:00
Ryan C. Gordon ac2edad809 audio: Simplify and unify audio stream format updating when devices change.
This used to do different things for recording streams in different parts of
the codebase, not to mention two separate codepaths through
UpdateAudioStreamFormatsPhysical in any case. My hope is this should kill off
a few corner case bugs...for example, this one:

Fixes #8402.
2024-12-13 14:59:16 -05:00
Ryan C. Gordon 9a9616894d wikiheaders: Fix uninitialized variable issue. 2024-12-13 13:52:35 -05:00
Ryan C. Gordon 80b9986418 audio: Fixed potential NULL dereference.
This could happen if you call SDL_BindAudioStreams() when the subsystem isn't
initialized, and possibly in other corner cases.

Thanks to Qianxin CodeSafe Team, @QiAnXinCodeSafe, for discovering this issue!

Fixes #11643.
2024-12-13 10:12:33 -05:00
Ryan C. Gordon e0cee83a3a emscriptenaudio: Removed comment about Firefox not supporting userActivation.
It does now, and has since Firefox 120 (around November 2023).
2024-12-12 10:48:23 -05:00
Ryan C. Gordon 2635239bbc README-migration: some improvements to the audio section.
Minor edit about default devices, and an explanation of forcing device buffer
size with SDL_HINT_AUDIO_DEVICE_SAMPLE_FRAMES.

Fixes #9857.
2024-12-12 01:29:56 -05:00
Ryan C. Gordon 6fe09e3aa4 dynapi: Minor optimization to SDL_SetError wrapper. 2024-12-11 18:04:43 -05:00
Ryan C. Gordon bbd4eeb287 examples/audio/04-multiple-streams: Note about web browser audio in README. 2024-12-11 14:13:52 -05:00
Ryan C. Gordon f45ce45603 ngage: Remove Nokia N-Gage support.
This can be reverted if a toolchain arrives that can handle C99 features like
variables declared in the middle of a scope, but for now we literally can't
compile SDL3 for this platform.

Fixes #11243.
2024-12-11 13:29:43 -05:00
Ryan C. Gordon 3f425b6f20 examples/audio/04-multiple-streams: Patched to compile on Visual Studio. 2024-12-11 13:25:43 -05:00
Ryan C. Gordon 1fbb8e1824 examples/audio/04-multiple-streams: Remove drag-and-drop support.
I'm going to reuse that code for an actual drag/drop example later, but for
simplicity and accessibility of the examples, this is just going to load two
wavs and loop them, so you get the music with a sword-clinking sound mixed
over it.
2024-12-10 23:10:43 -05:00
Ryan C. Gordon ac92af02ea wikiheaders: put a header on the quick reference pages. 2024-12-10 11:36:19 -05:00
Ryan C. Gordon be5fba963a wikiheaders: optionally generate a Quick Reference page.
Plus some fixes to SDL's headers this brought up.
2024-12-10 11:25:15 -05:00
Ryan C. Gordon 47429227ab examples: Handle newlines in README.txt better. 2024-12-06 13:25:06 -05:00
Ryan C. Gordon 0f228de48a examples: Add some metadata to the generated webpages. 2024-12-06 13:08:26 -05:00
Ryan C. Gordon b79e3ac830 examples: Let the browser handle README.txt word wrapping.
Now it's just inserts BR tags (not P tags atm) to separate paragraphs.
2024-12-06 00:13:30 -05:00
Ryan C. Gordon 90efb63e52 examples: Improve webpage generation in various ways, add thumbnails, etc. 2024-12-05 23:58:23 -05:00
Ryan C. Gordon e50dc7265b examples: Fix some window titles in the demos. 2024-12-05 23:58:23 -05:00
Ryan C. Gordon 951ca96dc9 asyncio: Added more category documentation. 2024-12-04 23:08:36 -05:00
Ryan C. Gordon 9784e10a75 audio: Let emscripten update device->sample_frames at device open time.
Fixes #11435.
2024-12-04 19:16:28 -05:00
Ryan C. Gordon 46f43c2e6e asyncio: Remove SDL_AsyncIOTask from the public API. 2024-12-03 17:32:20 -05:00
Ryan C. Gordon 4745aa3324 asyncio: Windows IoRing support, other tweaks and fixes. 2024-12-03 17:32:20 -05:00
Ryan C. Gordon 3ca629ceb5 asyncio: Allow file closes to request a flush/fsyncdata. 2024-12-03 17:32:20 -05:00
Ryan C. Gordon 022a6a9f97 asyncio: Added Linux io_uring support. 2024-12-03 17:32:20 -05:00
Ryan C. Gordon e79ce2a200 asyncio: Added async i/o APIs. 2024-12-03 17:32:20 -05:00
Ryan C. Gordon 65c9a58f5e audio: Make sure a few bitflag checks convert to bools correctly.
This might just be defensive coding, but better safe than sorry on this.
2024-12-03 11:04:52 -05:00
Ryan C. Gordon 2f59a1ce44 SDL_audio.h: Fixed a documentation typo (thanks, @JBetz!). 2024-12-01 19:36:03 -05:00
Ryan C. Gordon acf0f09320 SDL_migration.cocci: Fixed up some SDL3 symbols that had changed. 2024-11-30 20:08:38 -05:00