Commit Graph

15515 Commits

Author SHA1 Message Date
Ryan C. Gordon 03b7e02804
include: SDL_GLOB_CASESENSITIVE is associated with SDL_GlobDirectory.
Put it under the function so wikiheaders associates it with the right symbol.
2024-05-14 01:58:04 -04:00
Sam Lantinga 92301ae8a3 Fixed whitespace 2024-05-13 21:52:42 -07:00
Sam Lantinga 9b7f88e512 Pass the VR controller "back" button to the application on the Oculus Quest 2024-05-13 21:01:04 -07:00
Sam Lantinga 84fa11f740 Added missing events in SDL event logging
Also improved formatting for unknown events
2024-05-13 21:01:01 -07:00
Sam Lantinga be786aeb9d Fixed assertion, it's possible for the OS to grant permissions we haven't asked for. 2024-05-13 19:42:54 -07:00
SDL Wiki Bot 8b5f0d07e9 Sync SDL3 wiki -> header 2024-05-13 23:11:31 +00:00
Frank Praznik df3fea87d6 wayland: Rework scale-to-display
This extends the display scaling mode to be global and work in terms of pixels everywhere, with the content scale value set on displays. The per-window property had some issues, and has been removed in favor of retaining only the global hint that changes all coordinates to pixel values, sets the content scale on the displays, and generally makes the Wayland backend behave similarly to Win32 or X11.

Some additional work was needed to fix cases where displays can appear to overlap, since Wayland desktops are always described in logical coordinates, and attempting to adjust the display positions so that they don't overlap can get very ugly in all but the simplest cases, as large gaps between displays can result.
2024-05-13 19:10:19 -04:00
SDL Wiki Bot c7087fea01 Sync SDL3 wiki -> header 2024-05-13 22:07:34 +00:00
Sam Lantinga 5f1e01cce0 Added support for late swap tearing to the Vulkan renderer 2024-05-13 15:06:11 -07:00
Sam Lantinga 17520c2e6e Removed SDL_RendererFlags
The flags parameter has been removed from SDL_CreateRenderer() and SDL_RENDERER_PRESENTVSYNC has been replaced with SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_NUMBER during window creation and SDL_PROP_RENDERER_VSYNC_NUMBER after renderer creation.

SDL_SetRenderVSync() now takes additional values besides 0 and 1.

The maximum texture size has been removed from SDL_RendererInfo, replaced with SDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER.
2024-05-13 15:06:11 -07:00
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