15505 Commits

Author SHA1 Message Date
SDL Wiki Bot
678cfd23c0 Sync SDL3 wiki -> header 2024-05-13 21:30:12 +00:00
SDL Wiki Bot
7d6453ea33 Sync SDL3 wiki -> header 2024-05-13 21:24:33 +00:00
Ryan C. Gordon
766de7deff
SDL_audio.h: Whoops, one more documentation typo! 2024-05-13 17:24:08 -04:00
Ryan C. Gordon
7bc4bb9f96
SDL_audio.h: Fixed a documentation typo. 2024-05-13 17:23:21 -04:00
Petar Popovic
94cbaaabbf Renaming SDLK_QUOTE and SDLK_BACKQUOTE
Renaming SDLK_QUOTE to SDLK_APOSTROPHE.
Renaming SDLK_BACKQUOTE to SDLK_GRAVE.
This makes them similar to their scancode names.
2024-05-13 11:11:11 -07:00
SDL Wiki Bot
06d6f2cb25 Sync SDL3 wiki -> header 2024-05-13 16:09:32 +00:00
Sam Lantinga
b959203c9b Use SDL_WindowFlags appropriately in SDL test code 2024-05-13 09:08:44 -07:00
Sam Lantinga
fc62dfc6e2 Added properties for the swap chain in the direct3d11 and direct3d12 renderers
Fixes https://github.com/libsdl-org/SDL/issues/9775
2024-05-13 09:06:57 -07:00
Frank Praznik
f4aca6866c test: Free clipboard data after calling SDL_GetClipboardText()
Clipboard allocations were being leaked in two instances.
2024-05-13 10:27:24 -04:00
SDL Wiki Bot
486af58797 Sync SDL3 wiki -> header 2024-05-13 14:14:30 +00:00
Thomas J Faughnan Jr
ad166be1c5 Add SDL_HINT_AUDIO_DEVICE_APP_ICON_NAME 2024-05-13 10:13:01 -04:00
SDL Wiki Bot
8bd0433966 Sync SDL3 wiki -> header 2024-05-13 07:19:15 +00:00
Sam Lantinga
cb416922e3 Fixed compiling with WIN32_LEAN_AND_MEAN
Fixes https://github.com/libsdl-org/SDL/issues/9766
2024-05-12 16:00:21 -07:00
Sylvain
7b252634fd Fixed bug #9672 - v4l2/camera prevent deadlock when there is a delay between SDL_ReleaseCameraFrame and SDL_CloseCamera 2024-05-12 15:58:40 -07:00
Cyao
d4ce9183b8 Update SDL_portaldialog.c
Do not throw error when quitting with escape or closing the window
2024-05-12 09:41:13 -07:00
Anonymous Maarten
a4371d28ac doc: document how to use generator expressions + explain why we no longer provide CMake variables 2024-05-11 17:20:16 -04:00
Sam Lantinga
026edbeab0 Use the correct type for the modifier in SDL_Keysym
This shrinks the structure by 32-bits because we've removed implicit padding between the fields
2024-05-10 17:36:10 -07:00
Sam Lantinga
c95c415a0b Fixed warning C4244: '=': conversion from 'SDL_Keymod' to 'Uint16', possible loss of data 2024-05-10 16:43:09 -07:00
Sam Lantinga
8582bdaab8 Fixed warning C4244: 'function': conversion from 'Uint16' to 'Uint8', possible loss of data 2024-05-10 16:09:11 -07:00
Sam Lantinga
c64d7ed0aa Fixed warning C4244: '=': conversion from 'SDL_Keymod' to 'Uint16', possible loss of data 2024-05-10 16:07:17 -07:00
Sam Lantinga
71f3750ff1 Fixed SDL_GetPathInfo() return value on Windows
Fixes https://github.com/libsdl-org/SDL/issues/9755
2024-05-10 16:01:54 -07:00
Petar Popovic
9c6aa5066a PipeWire: removing log message 2024-05-10 13:06:20 -07:00
Sam Lantinga
a87fa020ac Don't enable enhanced report mode for Bluetooth Nintendo Switch controllers by default
This breaks applications using them in DirectInput mode, which isn't worth just getting battery status. We'll turn on enhanced mode if the application enables sensors.
2024-05-10 12:17:28 -07:00
Sam Lantinga
323bab9305 Fixed warning: implicit conversion loses integer precision: 'SDL_WindowFlags' (aka 'unsigned long') to 'Uint32' (aka 'unsigned int') 2024-05-10 08:56:32 -07:00
Ozkan Sezer
2205626816 SDL_iconv_string: simplify recomputation of outbuf and outbytesleft
Noticed this in SDL-1.2 where gcc-13 emits a -Wuse-after-free warning.
No such warning in SDL2 and SDL3, because unlike SDL1.2, SDL_realloc()
is not a macro expanding to libc realloc(). It warns, of course, if
SDL_realloc() is replaced with plain realloc():

src/stdlib/SDL_iconv.c: In function 'SDL_iconv_string_REAL':
src/stdlib/SDL_iconv.c:824:39: warning: pointer 'oldstring' may be used after 'realloc' [-Wuse-after-free]
  824 |             outbuf = string + (outbuf - oldstring);
      |                               ~~~~~~~~^~~~~~~~~~~~
src/stdlib/SDL_iconv.c:818:30: note: call to 'realloc' here
  818 |             string = (char *)realloc(string, stringsize + sizeof(Uint32));
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-05-10 18:50:32 +03:00
Ozkan Sezer
b2fca55e5c SDL_x11sym.h: corrected XQueryKeymap() proto.
Noticed this in SDL-1.2 in a gcc-13 build, which emitted the following
warning:  (No such warnings in SDL2 and SDL3, due to macro differences)

./src/video/x11/SDL_x11sym.h:84:48: warning: argument 2 of type 'char *' declared as a pointer [-Warray-parameter=]
   84 | SDL_X11_SYM(int,XQueryKeymap,(Display* a,char *b),(a,b),return)
      |                                          ~~~~~~^
./src/video/x11/SDL_x11dyn.c:95:15: note: in definition of macro 'SDL_X11_SYM'
   95 |         rc fn params { ret p##fn args ; }
      |               ^~~~~~
In file included from ./src/video/x11/SDL_x11dyn.h:27,
                 from ./src/video/x11/SDL_x11dyn.c:26:
/usr/include/X11/Xlib.h:2980:5: note: previously declared as an array 'char[32]'
 2980 |     char [32]           /* keys_return */
      |     ^~~~~~~~~

The original actually was char[32] but was changed with
8ada1e8a6e
(https://bugzilla.libsdl.org/show_bug.cgi?id=170
https://github.com/libsdl-org/SDL-1.2/issues/101)
2024-05-10 18:50:10 +03:00
SDL Wiki Bot
cd45e0a1ed Sync SDL3 wiki -> header 2024-05-10 14:30:13 +00:00
SDL Wiki Bot
7857d34d2c Sync SDL3 wiki -> header 2024-05-10 01:26:32 +00:00
Sam Lantinga
06a5d4d24f Documented the return value of SDL_GetDateTimeLocalePreferences() 2024-05-09 18:25:22 -07:00
Sam Lantinga
c1ba31118b Added ball, touchpad, and sensor support for virtual joysticks
Fixes https://github.com/libsdl-org/SDL/issues/9542
2024-05-09 18:25:22 -07:00
Ryan C. Gordon
d231edd2ad
SDL_dialog.h: Added missing \param lines to callback documentation. 2024-05-09 19:57:36 -04:00
SDL Wiki Bot
5f86f64f06 Sync SDL3 wiki -> header 2024-05-09 23:33:11 +00:00
Sam Lantinga
bcbf09acde Renamed SDL_AttachVirtualJoystickEx() to SDL_AttachVirtualJoystick()
The shorthand version of this function didn't allow specifying a controller name, which seems pretty important. It seems like anyone actually implementing a virtual joystick is going to want to use some of the extended functionality.
2024-05-09 14:05:58 -07:00
Sam Lantinga
598b4e0a1f Removed the limit on the number of supported renderer texture formats
Fixes https://github.com/libsdl-org/SDL/issues/9056
2024-05-09 13:30:07 -07:00
Wim Taymans
f3d79ad75f camera: make things work on older PipeWire 2024-05-09 13:19:27 -07:00
Wim Taymans
fb429f0dfe camera: work around old PipeWire versions 2024-05-09 13:19:27 -07:00
Wim Taymans
8186e4b322 camera: don't use newer PipeWire cleanup features 2024-05-09 13:19:27 -07:00
Wim Taymans
2b9ac185cd camera: improve PipeWire version checks
Remove the custom server version check. We can easily do this as part of
starting the hotplug loop. Check that we are at least running against a
1.0.0 server.

Log the compiled, linked, server and required versions.

Check that we are compiled and linked with the right version before using
the time symbol of a struct.
2024-05-09 13:19:27 -07:00
Wim Taymans
da06e67b1b camera: PipeWire 24 bits formats are endianness independent 2024-05-09 13:19:27 -07:00
Wim Taymans
3c7bccfb2b camera: clean up format table some more
Move the common formats outside of the ifdef
2024-05-09 13:19:27 -07:00
Wim Taymans
55d4b44441 camera: move PipeWire camera first in list
If it fails, we fall back to the next one, which is v4l2.
2024-05-09 13:19:27 -07:00
Wim Taymans
5d779153b2 camera: pipewire: only list formats with valid mapping 2024-05-09 13:19:27 -07:00
Wim Taymans
a340748c06 camera: add PipeWire camera support
The PipeWire camera will enumerate the pipewire Video/Source nodes with
their formats.

When capturing is started, a stream to the node will be created and
frames will be captured.
2024-05-09 13:19:27 -07:00
Ozkan Sezer
890ceb4ac4 SDL_stdinc.h: add fallback cases for SDL_SINT64_C and SDL_UINT64_C
These are needed when INT64_C and UINT64_C macros are either not
available (not likely), or guarded by __STDC_LIMIT_MACROS in C++
compilations (which is the case in many old SDKs.)
2024-05-09 20:55:56 +03:00
Ryan C. Gordon
9245084c06
SDL_video.h: Added a \sa from SDL_GLContext to SDL_GL_CreateContext. 2024-05-09 13:51:26 -04:00
Frank Praznik
87374af0a5 cocoa: Fix the window position when resizing
Cocoa will resize the window from the bottom-left instead of the top-left, so the position must be preserved when setting the new size.
2024-05-09 13:46:06 -04:00
Sam Lantinga
54fb629da5 SDL_WindowFlags is now 64-bit
Fixes https://github.com/libsdl-org/SDL/issues/7321
2024-05-09 10:39:54 -07:00
Susko3
895586c928 Use 1u literal for flags/masks calculation
Changes `1 <<` and `1<<` to use `1u`.
2024-05-09 10:29:48 -07:00
Sam Lantinga
1944c009e9 SDL_Keycode is now Uint32 2024-05-09 10:00:46 -07:00
SDL Wiki Bot
d3e28f3ab8 Sync SDL3 wiki -> header 2024-05-09 16:18:35 +00:00