Commit Graph

16902 Commits

Author SHA1 Message Date
SDL Wiki Bot
3f2f712fff Sync SDL3 wiki -> header 2024-04-28 12:29:13 +00:00
Sam Lantinga
0df12d223c Fixed crash cleaning up text
Text needs to be cleaned up before the renderer is freed.
2024-04-26 19:32:20 -07:00
Tyson Whitehead
0ab5a8a413 Initialize udev before joystick manual scan so class lookup works
LINUX_JoystickInit does a manual scan first so devices are sorted.
If SDL_UDEV_Init hasn't run by then, then the product info cannot
be looked up by SDL_UDEV_GetProductInfo and the initial-plugged-
in-device classification falls back to heuristic guessing.

(cherry picked from commit 0963c11af8)
2024-04-26 12:16:24 -07:00
SDL Wiki Bot
d42d661498 Sync SDL3 wiki -> header 2024-04-26 18:04:12 +00:00
Anonymous Maarten
817c45fc64 ci: build SDL on macos 13 (x86_64) 2024-04-26 17:09:31 +00:00
Petar Popovic
410a3c2c37 .gitignore: Adding compile_commands.json and .cache/ 2024-04-26 08:48:22 -07:00
Sam Lantinga
14f584a94b SDL_CreateWindowAndRenderer() takes the window title as the first parameter
Fixes https://github.com/libsdl-org/SDL/issues/9626
2024-04-25 20:00:14 -07:00
Sam Lantinga
2d7cc6ded0 Fixed getting the renderer info when creating a window texture 2024-04-25 17:32:56 -07:00
Sam Lantinga
ca61bf682a Make sure output parameters are zeroed in the case of an error 2024-04-25 16:46:44 -07:00
Sam Lantinga
04f1901751 Fixed window flashing under X11 when creating a window and OpenGL renderer 2024-04-25 16:42:43 -07:00
Ethan Lee
26b71d14e9 storage: Static analysis fix 2024-04-25 19:40:07 -04:00
SDL Wiki Bot
57f96fb124 Sync SDL3 wiki -> header 2024-04-25 21:23:14 +00:00
SDL Wiki Bot
1b8d4d77d6 Sync SDL3 wiki -> header 2024-04-25 21:01:12 +00:00
Ryan C. Gordon
2ee1c87eb0 wikiheaders: Fixed preprocessor line check to include #endif.
Reference Issue #9557.
2024-04-25 16:46:43 -04:00
Ryan C. Gordon
6b1a98e664 wikiheaders: Allow basic typedefs to pull in some preprocessor logic.
Reference Issue #9557.

This lets SDL_AudioFormat have the `#if byteorder == lilendian` section.
2024-04-25 16:44:09 -04:00
SDL Wiki Bot
a13bdeee8a Sync SDL3 wiki -> header 2024-04-25 20:40:14 +00:00
Petar Popovic
e0b45fed06 testlock.c: replace function call kill with raise
Replacing function call `kill(0, SIGINT);` with `(void)raise(SIGINT);` in file test/testlock.c.
The `kill()` function is not available on Unix systems when compiling without system extensions enabled.
2024-04-25 15:11:08 -04:00
Ryan C. Gordon
d29b861a76 wikiheaders: Allow blank lines in post-typedef #define blocks.
Reference Issue #9557.
2024-04-25 14:26:49 -04:00
Sam Lantinga
ac5a61cd60 Fixed build error (thanks @sezero!) 2024-04-25 09:45:10 -07:00
Tyson Whitehead
391b8c0c07 Avoid opening non-joystick devices if possible to speedup scanning
Closing a device file takes 0.01 to 0.5s, which can add up to
significant startup delays. The udev classification does not
require opening the actual device files, so, use it if possible,
and only fall back to opening the device and probing otherwise.

(cherry picked from commit 45b804c158)
2024-04-25 08:49:48 -07:00
Ryan C. Gordon
2fb024ab8e wikiheaders: Defines directly following a non-struct typedef are documented.
The idea is that if you have a `typedef Uint32 MyFlags` that has a bunch of
defines that are meant to be bitflags, you can pack them into the same wiki
page automatically.

This only works with `typedef`s that are _not_ struct/union/enums, and it
only pulls in `#define` lines that immediately follow the typedef line.
Even a blank line or a comment will signal to stop including lines for
this page!
2024-04-25 03:02:27 -04:00
SDL Wiki Bot
47ff4addd4 Sync SDL3 wiki -> header 2024-04-25 06:37:31 +00:00
Ryan C. Gordon
2733345422 SDL_audio.h: Documentation updates. 2024-04-25 02:36:08 -04:00
Ozkan Sezer
3959765b81 SDL_waylandvulkan.c: fix type redefinition errors.
Fixes https://github.com/libsdl-org/SDL/issues/9620
2024-04-25 03:50:00 +03:00
SDL Wiki Bot
ceeefb0512 Sync SDL3 wiki -> header 2024-04-24 20:43:29 +00:00
Ryan C. Gordon
cdb3cea76d SDL_atomic.h: Documentation updates. 2024-04-24 16:42:16 -04:00
Ryan C. Gordon
ec97857a87 SDL_assert.h: Documentation improvements. 2024-04-24 15:17:31 -04:00
Sam Lantinga
e56f05bac1 Fixed unclipping the mouse when a monitor is placed left of the primary one on Windows.
There is now a desktop bounds variable that could potentially be exposed in the API if we wanted.
2024-04-24 12:06:00 -07:00
SDL Wiki Bot
5fbc038375 Sync SDL3 wiki -> header 2024-04-24 17:20:14 +00:00
Frank Praznik
b41699e9c4 event: Always clear the mouse capture flag, even if the backend capture function isn't implemented.
Some backends, such as Wayland, don't support explicit mouse capture, and thus don't implement the backend function to do so, but do set/unset the capture flag on button events to handle cases where a button is pressed and the pointer is dragged outside the window.

If the backend doesn't support explicitly setting the mouse capture mode, manually clear the capture flag when the window has had the focus forcibly removed, to avoid sending bogus motion events as well as an assert condition.
2024-04-24 12:40:56 -04:00
Sam Lantinga
98582dca02 Fixed Win+V handling (pasting from clipboard history) on Windows
Fixes https://github.com/libsdl-org/SDL/issues/9613
2024-04-24 09:35:19 -07:00
Sam Lantinga
30d93fb29b Relax, it's not that exciting :) 2024-04-24 09:19:38 -07:00
Ryan C. Gordon
4a11809370 SDL_TextInputEvent: Note that text field is UTF-8 encoded.
Reference Issue https://github.com/libsdl-org/sdlwiki/issues/516
2024-04-24 11:18:35 -04:00
Petar Popovic
b98116a996 Removing trailing commas in enums in SDL headers
Trailing commas in enums is a C99 feature.
This commit removes them in SDL headers for ANSI compatibility.
2024-04-24 09:44:41 -04:00
Ryan C. Gordon
be6b8dead4 CaseFoldUtf8String: Fixed to actually work with Unicode values.
I think this started off as a UTF-32 output, and I forgot to actually
finish this off to encode back to UTF-8.

Fixes #9607.
2024-04-23 18:57:48 -04:00
Sam Lantinga
8acb91936a Fixed warning, needs more work by @icculus 2024-04-23 14:35:55 -07:00
Sam Lantinga
bcd2807065 Fixed warning C4244: 'initializing': conversion from 'int' to 'SDL_AudioFormat', possible loss of data 2024-04-23 14:12:05 -07:00
Ryan C. Gordon
42579e2af1 docs: Remove README-hg.md
It's been a few years in general, and SDL3 has never been in Mercurial.

We'll leave this document alive in the SDL2 branch, though!
2024-04-23 15:48:29 -04:00
Ryan C. Gordon
30970780a9 include: Fixed some old Doxygen markup to be Markdown instead. 2024-04-23 14:38:04 -04:00
Frank Praznik
7729a8b5c3 x11: Don't try to capture mouse input via X when XInput2 is in use
Trying to capture the pointer via XGrabPointer() when XInput2 is in use will always fail with 'AlreadyGrabbed', since the pointer is already grabbed by XInput2.
2024-04-23 11:59:36 -04:00
Sam Lantinga
42f8e94d11 mac: Fix SDLWindow nswindow member no longer being cleaned up in Cocoa_DestroyWindow
- A refactor changed how SetupWindowData handled external windows where previously it was tracked
  in a field of SDL_CocoaWindowData but now it is tracked by setting SDL_WINDOW_EXTERNAL in the
  window flags. Removed the now unused field and updated the external window check in DestroyWindow.
2024-04-23 06:20:30 -07:00
Ryan C. Gordon
cfabb7a9ac wikiheaders-options: Clean up header file info a bit more. 2024-04-22 23:54:40 -04:00
Brick
c9cfc681b9 Workaround GCC bug in audio resampler 2024-04-22 18:38:55 -04:00
Ryan C. Gordon
acf811a06b Revert "dynapi: Remove unused ENABLE_SDL_CALL_LOGGING code."
This reverts commit 9128f92f38.

Apparently this is useful for debugging from time to time!
2024-04-22 17:01:07 -04:00
Ryan C. Gordon
3dcacd2dc8 wikiheaders_options: People can include specific headers if they want!
Fixes #9536.
2024-04-22 16:59:31 -04:00
yassineimounachen
5ffb2f47d1 Add USB IDs for the Thrustmaster TS-XW racing wheel
To be of use, this depends on https://github.com/berarma/oversteer/pull/200 and https://github.com/Kimplul/hid-tmff2/pull/94.
2024-04-22 11:35:31 -07:00
Ryan C. Gordon
39d0e62ef5 dynapi: Remove DISABLE_JUMP_MAGIC.
The "jump magic" codepath was never written, and would have involved a lot
of low-level and platform/processor/compiler specific work.

A better solution is for compilers to treat the function call in the jump
table functions as a tail call, which would effectively produce the same
result in a portable way.

Clang already has a way to do this that we could add later. But this wouldn't
need a separate "jump magic" section.
2024-04-21 22:16:48 -04:00
Ryan C. Gordon
9128f92f38 dynapi: Remove unused ENABLE_SDL_CALL_LOGGING code.
This was hardcoded to disabled, since building it in bloated the binary
massively for little gain (one could probably accomplish this same thing
with ltrace or something).

If we need it, we'll pull it out of revision control.
2024-04-21 22:13:43 -04:00
Ryan C. Gordon
7a36504952 storage: SDL_WriteStorageFile() wasn't marked as SDLCALL.
Fixes #9594.
2024-04-21 09:26:07 -04:00
Erik Scholz
c623bd2fdc reword SDL_BlitSurfaceScaled param
so it will link to the type in the docs/wiki
2024-04-20 07:51:40 -07:00