Commit Graph

20262 Commits

Author SHA1 Message Date
DamianS-eng
3b90ce4995 Fix spacing; tabs to 4 spaces 2025-03-15 16:19:36 -07:00
DamianS-eng
60857935ca Add preliminary joystick support for snake example 2025-03-15 16:19:36 -07:00
Cameron Gutman
aad1e35162 mouse: Allow use of integer coordinates with fractional wheel events
SDL 2.0.18 added preciseX/Y to mouse wheel events, which we cannot
emulate in sdl2-compat without a mechanism to control integer position
and scroll deltas separately.
2025-03-15 13:43:50 -07:00
Sam Lantinga
501e71f25f Added unaligned version of SDL_ConvertPixels_SwapNV_std()
Fixes https://github.com/libsdl-org/SDL/issues/12546
2025-03-15 09:24:25 -07:00
Sam Lantinga
ad9f9af4ed Removed accidentally enabled debug code 2025-03-15 09:17:55 -07:00
Sam Lantinga
efe122be4d Removed width/height parameters from LoadTexture()
You can directly access the texture width and height now.
2025-03-14 11:38:13 -07:00
Sam Lantinga
dcb97a5f49 Set a default shader entry point
The default should be the entrypoint generated by SDL_shadercross. That way it doesn't need to be hand-specified in the common workflow.
2025-03-14 11:38:13 -07:00
Frank Praznik
1a2fccc56a hints: The auto mode switching hint is for 3.4.0
This is a feature addition with a slight behavior change, not a bug fix, so move it to 3.4.0.
2025-03-14 14:12:15 -04:00
SDL Wiki Bot
285fa671aa Sync SDL3 wiki -> header
[ci skip]
2025-03-14 17:46:58 +00:00
Frank Praznik
0bfe0497f3 video: Add a hint to disable auto mode switching if an exclusive fullscreen window moves between displays
The existing behavior helps clients that don't expect exclusive fullscreen windows to move by maintaining a consistent size and mode, however, some are aware that this can occur and want to handle mode selection themselves.

Add a hint to disable auto mode switching when an exclusive fullscreen window moves to accommodate this use case, and don't override fullscreen changes that may occur in an event watcher between the display changed event being posted and SDL running the display changed handler, as the mode switch may have already been handled there by the client.
2025-03-14 13:46:00 -04:00
Maia
58f6e9c278 Fix trailing doc comments 2025-03-14 10:04:32 -07:00
SDL Wiki Bot
f15832c685 Sync SDL3 wiki -> header
[ci skip]
2025-03-14 16:40:38 +00:00
Temdog007
17b84dbcf3 emscripten: add window properties for canvas ID and keyboard element (#12509)
Move hints used by Emscripten to window properties. This change will be necessary if multiple windows for Emscripten will be supported in the future.

- Added Window Create Property SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID
- Added Window Create Property SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT
- Use hint SDL_HINT_EMSCRIPTEN_CANVAS_SELECTOR as override to SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_CANVAS_ID
- Use hint SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT as override to SDL_PROP_WINDOW_CREATE_EMSCRIPTEN_KEYBOARD_ELEMENT
2025-03-14 09:39:46 -07:00
Sam Lantinga
ffe69fc354 Fixed SDL_GPUTextureSupportsSampleCount() documentation
Fixes https://github.com/libsdl-org/sdlwiki/issues/751
2025-03-14 09:30:19 -07:00
SDL Wiki Bot
e671bc2658 Sync SDL3 wiki -> header
[ci skip]
2025-03-14 16:27:22 +00:00
Sam Lantinga
02faa8f75c Rename SDL_SetGPURenderStateFragmentUniformData() to SDL_SetGPURenderStateFragmentUniforms() 2025-03-14 09:26:30 -07:00
Sam Lantinga
96194347bc Added an example of fullscreen shader effects with the GPU renderer 2025-03-14 09:26:30 -07:00
Sam Lantinga
2aee105b43 Added support for custom shaders with the GPU renderer
Added an example of MSDF font rendering with the SDL 2D renderer
2025-03-14 09:26:30 -07:00
SDL Wiki Bot
eb56c8af85 Sync SDL3 wiki -> header
[ci skip]
2025-03-14 12:49:08 +00:00
Sam Lantinga
1ae4ef65e6 Fixed incorrect assert 2025-03-13 22:37:08 -07:00
Sam Lantinga
3e9e22f17d Added SDL_SCALEMODE_PIXELART
This is based on the algorithm presented by t3ssel8r:
https://www.youtube.com/watch?v=d6tp43wZqps
2025-03-13 09:48:37 -07:00
Sam Lantinga
853375da61 Removed texture_size from the GPU renderer vertex shader
This isn't used anywhere, and this saves a UV multiply and divide
2025-03-13 09:48:37 -07:00
Sam Lantinga
28ec461ebf Organize the GPU renderer draw code 2025-03-13 09:48:37 -07:00
Sam Lantinga
af0420d898 Switched GPU renderer shaders to shadercross and HLSL 2025-03-13 09:48:37 -07:00
Ryan C. Gordon
c318b1f926 SDL_mutex.h: Fixed code example. 2025-03-13 10:08:32 -04:00
Caleb Cornett
0e29c6295c gpu: Clean up unused code in Vulkan and D3D12 drivers 2025-03-13 09:30:36 -04:00
SDL Wiki Bot
71c4de190c Sync SDL3 wiki -> header
[ci skip]
2025-03-12 22:23:23 +00:00
Frank Praznik
512d97eaba cocoa: Set the internal window data before calling methods that may result in referencing the internal data 2025-03-12 17:08:22 -04:00
Sam Lantinga
5e951a230e windows: Fix WIN_SetWindowAlwaysOnTop causing owner window z-order changes when child windows are created or change top-level status
- WIN_SetWindowAlwaysOnTop is always called as part of window creation (normally setting HWND_NOTOPMOST) which also set the z-order for the parent
  window when child windows are created. Since HWND_NOTOPMOST is above all non-topmost windows this had the effect of reordering but not focusing
  the parent window.
2025-03-12 13:06:31 -07:00
Sam Lantinga
50a397bb45 Removed help for obsolete (and removed) command line option 2025-03-12 12:38:34 -07:00
Sam Lantinga
3235a4eb4f Initialize the padding of aligned allocations to zero
Fixes valgrind uninitialized memory errors when doing SIMD blits
e.g. testautomation --filter surface_testScale
2025-03-12 11:42:02 -07:00
Ivan Epifanov
efaafd766e VITA: Remove unused/duplicate headers 2025-03-12 09:20:05 -07:00
Joshua T. Fisher
7746a9656e Fixup the mingw readme cmakelists 2025-03-11 19:42:28 -07:00
Sam Lantinga
2ce3dfdf1d Fixed Nintendo controller face button layout under Steam 2025-03-10 17:25:01 -07:00
Sam Lantinga
be6ed6e9c4 Fixed sscanf("026", "%1x%1x%1x", &r, &g, &b)
Fixes https://github.com/libsdl-org/SDL/issues/12510
2025-03-10 14:45:08 -07:00
Sam Lantinga
24339524c5 Use sized types when fixing undefined behavior 2025-03-10 09:12:40 -07:00
rohlem
f1d16e9b4d avoid UB (left shift of negative number) in SDL_windowsevents.c 2025-03-10 09:09:46 -07:00
Caleb Cornett
9fcca83512 gpu: Validate that CopyGPUTextureToTexture formats match 2025-03-09 17:29:47 -04:00
Frank Praznik
f2866418d4 wayland: Fix enum/boolean comparison and assignment 2025-03-09 11:55:05 -04:00
Cameron Gutman
597bfe6b27 mouse: Add internal integer mouse mode hint for sdl2-compat
Performing this inside SDL3 dramatically simplifies sdl2-compat. See https://github.com/libsdl-org/sdl2-compat/issues/372.
2025-03-08 19:06:36 -08:00
bobsayshilol
65cd2256c5 emscripten: Fix handling of special HTML targets
With ASAN enabled the existing code triggered null-pointer-dereference
in the strcmp since EMSCRIPTEN_EVENT_TARGET_WINDOW is a "fake" pointer
with the value ((const char*)2). In fixing this it was also noticed
that using the #window/#document/#screen targets as mentioned in the
docs fails since document.querySelector() returns null for them and we
should instead be mapping them to the special HTML targets provided.
2025-03-08 17:15:43 -08:00
TheMode
5d804a39d9 Implement SDL_GetSystemRAM and SDL_GetNumLogicalCPUCores for the 3ds (#12494) 2025-03-08 09:51:37 -08:00
Sam Lantinga
99336ea378 Fixed memory leak in memory leak tracking 2025-03-08 09:18:25 -08:00
ds-sloth
0306b5a865 Fix n3ds/SDL_syssem.c:SDL_SignalSemaphore (libsdl-org/SDL#12411) 2025-03-07 17:31:06 -08:00
Sam Lantinga
3353b92a96 Fixed pen events on iOS after reinitializing SDL
We weren't resetting apple_pencil_id, so not re-registering it later.
2025-03-07 16:32:53 -08:00
Frank Praznik
ad2584813f cocoa: Ignore both clicks and motion on tooltip windows 2025-03-07 15:05:18 -05:00
Frank Praznik
fe245c6e0d x11: Always synthesize size events for external windows
External windows may call this to update the renderer size, but not pump SDL events, either by syncing or running an event loop, so the size event always needs to be synthesized for external windows. If it is wrong, the true size will be sent if/when events are processed.
2025-03-07 14:12:14 -05:00
Frank Praznik
84d047cc11 wayland: Rollback the round trip when reading data offers
The bug this appeared to fix turned out to be randomly occurring and has other causes, and the read pipe is already polled for readiness, so this extra overhead isn't necessary.
2025-03-07 13:02:23 -05:00
SDL Wiki Bot
fc35107854 Sync SDL3 wiki -> header
[ci skip]
2025-03-07 17:01:23 +00:00
Sam Lantinga
d631a3add0 Add a link to docs/INTRO-mingw.md 2025-03-06 16:25:17 -08:00