Commit Graph

10372 Commits

Author SHA1 Message Date
Petar Popovic
d2ef15d8e6 Fix warnings: calloc-transposed-args 2024-09-08 19:28:11 -07:00
Petar Popovic
aa6a0be7a8 Fix warning: redefinition of typedef 'SDLTest_TestSuiteRunner' 2024-09-08 15:36:51 -07:00
Petar Popovic
257385277d SDL_realloc() with size 0 now always defaults to size 1 2024-09-08 06:39:37 -07:00
Anonymous Maarten
4c0cb94b96 vulkan: VULKAN_CreateTexture returns a boolean
Fixes regression introduced by 9ff3446f03
VK_SUCCESS == 0, where failure needs to return false (0).
2024-09-08 13:14:18 +02:00
Anonymous Maarten
3eb49ac862 vulken: VULKAN_CreateTexture returns a boolean
Fixes regression introduced by 9ff3446f03
VK_SUCCESS == 0, where success needs to return true (1).
2024-09-08 12:42:55 +02:00
cosmonaut
1a13acac09 Always blit to the swapchain in GPU_RenderPresent
Fixes #10744
2024-09-07 08:43:02 -07:00
Evan Hemsley
68a9991ec9
GPU: Document structs (#10742) 2024-09-07 08:29:14 -07:00
Sam Lantinga
cf9613fe63 The GPU log category ate one of the SDL reserved categories 2024-09-07 07:57:29 -07:00
Daniel Ludwig
1849205733 Fix GDK builds after renames done in #10730 2024-09-07 11:50:40 +03:00
Daniel Ludwig
0a44ea1b0b Amend use of non-standard compiler syntax 2024-09-07 11:50:40 +03:00
Sam Lantinga
1d59be67fc Fixed crash if PIPEWIRE_PREFERRED_Init() fails and then pipewire is used anyway
The symbols were unloaded, but not reloaded because pipewire_initialized was still true.
2024-09-06 17:26:45 -07:00
Caleb Cornett
9730f62e8c
GPU: Rename struct members and parameters for SDL3 naming conventions (#10730)
---------

Co-authored-by: Evan Hemsley <2342303+thatcosmonaut@users.noreply.github.com>
2024-09-06 16:38:23 -07:00
Timothee Besset
e21f70c593 pipewire : check minimum client library version early 2024-09-06 14:52:46 -07:00
Sam Lantinga
4c8357a37d Clarified why the WINDOWS driver is lower than the RAWINPUT driver 2024-09-06 11:27:51 -07:00
Sam Lantinga
66b4c080c0 Clarified why the WGI driver is lower than the WINDOWS driver 2024-09-06 11:25:57 -07:00
Sam Lantinga
8f46cb771c SDL_XINPUT_Enabled() returns false until XInput DLL is successfully loaded
We make sure we initialize XInput first, so that anything checking whether it's enabled gets a valid result based on whether we were able to load it or not.
2024-09-06 11:21:06 -07:00
Ryan C. Gordon
ac08dde1b2 windows: Clean out things that should be using defined(SDL_PLATFORM_WINDOWS). 2024-09-06 13:28:39 -04:00
Ryan C. Gordon
154452a726 winrt: Removed WinRT/Windows Phone/UWP support.
Fixes #10724.
2024-09-06 13:28:39 -04:00
Sam Lantinga
6d7c211faf Fixed race condition at startup that could cause a crash in the XInput driver 2024-09-06 10:15:16 -07:00
Sam Lantinga
1381cc8554 Add a step to fix generated shader code 2024-09-06 09:09:01 -07:00
Sam Lantinga
104642ffe7 Sorted API symbols 2024-09-06 08:57:40 -07:00
Sam Lantinga
4c382aafcd Fixed building on Raspberry Pi 2024-09-06 08:54:05 -07:00
Anonymous Maarten
360bc667a8 SDL_Log: restore SDL2's SDL_LogCategory order 2024-09-06 17:40:59 +02:00
Anonymous Maarten
db96ddca34 SDL_test: use SDLCALL calling convention
This is needed when using a pre-built static SDL3_test library.
2024-09-06 14:19:05 +02:00
Sam Lantinga
379aea5c2d Fixed warnings building with Visual Studio 2024-09-05 20:24:30 -07:00
Sam Lantinga
8edb901724 Fixed crashes in Metal renderer due to ARC releasing references on random memory in newly allocated structs 2024-09-05 19:48:33 -07:00
Sam Lantinga
702ed83f72 Initialize interface structures so they can be extended in the future
We guarantee that we will only add to the end of these interfaces, and any new fields will be optional.
2024-09-05 19:16:00 -07:00
Anonymous Maarten
102b3b480b SDL_test: move argument parsing into SDL_test 2024-09-06 03:06:40 +02:00
Anonymous Maarten
09af4a8086 SDL_test: make argument parsing extendable 2024-09-06 03:06:40 +02:00
Anonymous Maarten
396dd16471 SDL_test: Remove unused common_usage_* static char pointers 2024-09-06 03:06:40 +02:00
Anonymous Maarten
872608b8af Don't allocate in SDLTest_GenerateRunSeed 2024-09-06 03:06:40 +02:00
Anonymous Maarten
2f4b2df595 SDL_test: pass data pointer to unit tests 2024-09-06 03:06:40 +02:00
Anonymous Maarten
baa1a5e2f4 Add SDL_strpbrk 2024-09-06 01:35:43 +02:00
Anonymous Maarten
55934bc85e include: add SDL_RESTRICT for restricted pointer aliasing 2024-09-06 01:35:43 +02:00
Caleb Cornett
2d4eb29c37
Add SDL_SetGPUBlendConstants, SDL_SetGPUStencilReference (#10704) 2024-09-05 17:41:23 -05:00
Ozkan Sezer
f494658f9c SDL_gpu.c: remove BOM. 2024-09-05 22:39:02 +03:00
Ozkan Sezer
cb2919ac55 [GPU] MinGW build fixes:
- CreateEventEx() is guarded by _WIN32_WINNT >= 0x0600:
  In SDL_gpu_d3d12.c, include core/windows/SDL_windows.h
  that defines _WIN32_WINNT properly to account for that
- DXGIInfoQueue stuff is not available in all toolchains
  such as mingw-w64 version 8.0.3
- SDL_gpu_d3d11.c: _WIN32 is always defined by MinGW, as
  is the case for all windows-targeting compilers, so it
  doesn't guarantee absence of DXGIInfoQueue stuff:
  rely on __IDXGIInfoQueue_INTERFACE_DEFINED__, as it is
  done elsewhere.

Fixes: https://github.com/libsdl-org/SDL/issues/10705 .
2024-09-05 22:39:02 +03:00
Frank Praznik
a46e7027ce video: Allow setting the parents of toplevel windows
Allow setting a parent/child relationship on toplevel windows, which allows raising sets of windows together, and allows child windows to always float above their parents.

Modal windows are now set by setting the parent, then toggling modal status, as the previous interface duplicated functionality now handled by SDL_SetWindowParent().
2024-09-05 15:22:23 -04:00
Sam Lantinga
387774ab8a Build config flags are either defined or undefined, never 0
This is for consistency with CMake build configuration

Also added SDL_VIDEO_RENDER_GPU to the non-CMake build configurations
2024-09-05 09:52:40 -07:00
David Gow
e3fd581aca GPU: vulkan: Respect swapchain minImageCount
The default value of MAX_FRAMES_IN_FLIGHT (3) may be less than the
minImageCount returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR() on
some setups. For example, the Intel IVB Vulkan driver on Wayland returns
a minImageCount of 4, resulting in the following validation warning:

VUID-VkSwapchainCreateInfoKHR-presentMode-02839(ERROR / SPEC): msgNum: -76493605 - Validation Error: [ VUID-VkSwapchainCreateInfoKHR-presentMode-02839 ] | MessageID = 0xfb70ccdb | vkCreateSwapchainKHR(): pCreateInfo->minImageCount 3, which is outside the bounds returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR() (i.e. minImageCount = 4, maxImageCount = 0). The Vulkan spec states: If presentMode is not VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR nor VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR, then minImageCount must be greater than or equal to the value returned in the minImageCount member of the VkSurfaceCapabilitiesKHR structure returned by vkGetPhysicalDeviceSurfaceCapabilitiesKHR for the surface (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkSwapchainCreateInfoKHR-presentMode-02839)
    Objects: 0

Use the minimum image count in that case, as it's as close as we'll get
to our preferred value. Note also that, unlike maxImageCount,
minImageCount is never 0 (the spec states it is always at least 1), so
we don't need a similar check to see if it applies.

Signed-off-by: David Gow <david@ingeniumdigital.com>
2024-09-05 08:10:18 -07:00
Sylvain
41810c823d Compilation without vulkan: SDL_GPU_VULKAN is always defined for some plateform (at android, macos), test against 0 or 1 2024-09-05 05:36:21 -07:00
Quinn X. J.
f61d4db39a GPU: colorAttachmentDescriptions should be const
The `colorAttachmentDescriptions` field of `SDL_GPUGraphicsPipelineAttachmentInfo` should be marked `const`,
similarly to the `vertexBindings` and `vertexAttributes` fields of `SDL_GPUVertexInputState`.
2024-09-05 05:22:52 -07:00
Sam Lantinga
20d0a1a3d1 Added a defensive check against XINPUTGETCAPABILITIES being NULL
This should never happen, but it does, possibly due to a data segment overwrite elsewhere.
2024-09-04 16:30:27 -07:00
Sam Lantinga
abd2ac5992 Set the desired channel count when opening audio on Android 2024-09-04 13:59:48 -07:00
Sam Lantinga
e2c9a0a427 Updated Android audio log messages 2024-09-04 13:59:48 -07:00
Evan Hemsley
1788be8547
GPU: Add const to some function parameters (#10694) 2024-09-04 13:53:41 -07:00
Sam Lantinga
c9387bcca5 pipewire: spa_list_is_empty() returns bool 2024-09-03 13:45:00 -07:00
Sam Lantinga
0fd275e16e pulseaudio: fixed cleanup if couldn't connect to pulseaudio server 2024-09-03 13:34:19 -07:00
Sam Lantinga
a56315cd48 Fixed return value failing to load pulseaudio functions 2024-09-03 13:24:27 -07:00
Sam Lantinga
7ca676aeed Use ASCII characters in SDL source and headers
Fixes https://github.com/libsdl-org/SDL/issues/10636
2024-09-03 12:52:27 -07:00
Daniel Ludwig
b1b4a9cd1b
GDK build: PFN_D3D12_XBOX_CREATE_DEVICE not defined for Xbox One (#10690) 2024-09-03 08:09:00 -05:00
Sam Lantinga
73898a0a64 Renamed NDA platform constants to "PRIVATE" 2024-09-02 21:00:34 -07:00
Sam Lantinga
35dadda327 Fixed build warnings 2024-09-02 17:17:48 -07:00
Sam Lantinga
eacf119923 Renamed SDL_size_add_overflow() and SDL_size_mul_overflow() 2024-09-02 17:17:48 -07:00
Andrei Alexeyev
fb7245fb93
GPU: Add support for more texture formats (#10641) 2024-09-02 19:14:48 -05:00
Caleb Cornett
f405def691
Change GPU flag enums to defines (#10681) 2024-09-02 15:19:43 -07:00
Sam Lantinga
d501f6db07 Make newer DRM and GBM functions optional
Fixes https://github.com/libsdl-org/SDL/issues/10675
2024-09-02 10:37:50 -07:00
Sam Lantinga
8371114009 Fixed error: multiple storage classes in declaration specifiers 2024-09-02 09:50:19 -07:00
Sam Lantinga
93423c1c46 spin_acquire_lock() takes a volatile pointer parameter 2024-09-02 09:50:19 -07:00
Sam Lantinga
01fa9cad80 Fixed error: conflicting types for 'getpagesize' 2024-09-02 09:50:19 -07:00
Sam Lantinga
8b0798a3da Fixed error: variable 'nfences' set but not used 2024-09-02 09:50:19 -07:00
Sam Lantinga
b5700ccc02 Updated dlmalloc to version 2.8.6
From https://gee.cs.oswego.edu/pub/misc/malloc-2.8.6.c
2024-09-02 09:50:19 -07:00
Davis Gallinghouse
deb313dd99 GPU: Compile Metal shader source from NSString
Using the @() syntax to construct an NSString assumes the parenthesized
pointer is null-terminated, but the Metal shader source included in
render/sdlgpu/shaders/metal.h is not null-terminated.

Quoting the clang documentation on Objective-C literals:

    When the type of the parenthesized expression is (char *) or (const
    char *), the result of the boxed expression is a pointer to an
    NSString object containing equivalent character data, which is
    assumed to be ‘\0’-terminated and UTF-8 encoded.

Because the @() syntax assumes null-termination, it may read garbage
data after the shader source (up to the next null byte), which can then
cause the Metal shader compiler to fail. To prevent this, instead of
using the @() boxing syntax, we explicitly construct an NSString using
the string length passed by the caller.
2024-09-02 07:20:36 -07:00
Sam Lantinga
df501040fd Fixed random seed not affecting SDLTest_RandomIntegerInRange() 2024-09-01 14:05:27 -07:00
Zero
2c0ffdc6d5
GPU: Pass the new window size when resizing the swapchain for d3d12 (#10665) 2024-09-01 08:48:29 -07:00
Andrei Alexeyev
d4b8072614
GPU: Fix and generalize BytesPerRow() and BytesPerImage() (#10663)
These functions had special cases for a few BC formats, but all
block-compressed formats should need the same logic. Furthermore they
weren't handling the sRGB variants of those formats.
2024-08-31 23:07:38 -07:00
coffeechriph
b15d79a35a Fix texture_rgba_frag for metal in SDL_shaders_gpu.c 2024-08-31 20:09:11 -07:00
Anonymous Maarten
c11b58ead7 Increase maximum line length of SDLTest_LogAllocations 2024-09-01 02:19:39 +02:00
Sam Lantinga
b17ca32d8c Changed GPU driver names to match renderer driver names
Fixes https://github.com/libsdl-org/SDL/issues/10650
2024-08-31 10:06:27 -07:00
Sam Lantinga
51a0b58f75 GPU logging should be quiet by default 2024-08-31 09:52:21 -07:00
Sam Lantinga
6c30a0f60b Added scaleMode validation to SDL_SetTextureScaleMode() 2024-08-31 09:43:02 -07:00
Anonymous Maarten
63e58e5d66 SDL_Log: always use WriteFile/WriteConsole on Windows
OutputDebugString and fprintf(stderr) (of mslibc) both output
to the debug window of Visual Studio.
In other debuggers (e.g. RAD), this does not happen.

To avoid double output, this commit always uses WriteFile/WriteConsole.
2024-08-31 17:48:57 +02:00
Anonymous Maarten
8ffc1c2705 SDL_Log: don't rely on printf to forward stderr to the debug stream
This partially reverts 125ce71379
2024-08-31 17:48:57 +02:00
Sam Lantinga
f827c1322c Renamed SDL_Del* to SDL_Remove* 2024-08-31 07:46:28 -07:00
Sam Lantinga
cf1d8e2dfd Renamed SDL_AtomicSetPtr() and SDL_AtomicGetPtr()
Fixes https://github.com/libsdl-org/SDL/issues/10601
2024-08-31 07:46:28 -07:00
Jan Sedivy
00708b976a GPU Metal: Fix uninitialized memory 2024-08-31 07:29:32 -07:00
Sam Lantinga
2010a22f44 Removed unneeded separate return statement. 2024-08-31 07:26:13 -07:00
Sam Lantinga
4759a97c09 Fixed return value from D3D12_UpdateVertexBuffer()
Fixes https://github.com/libsdl-org/SDL/issues/10649
2024-08-31 07:26:13 -07:00
Anonymous Maarten
31a5f3b833 Fix C4090: 'function': different 'const' qualifiers 2024-08-31 06:49:33 -07:00
Frank Praznik
5d5a685a80 wayland: Add support for setting window icons via the xdg-toplevel-icon-v1 protocol 2024-08-31 09:38:43 -04:00
Anonymous Maarten
ea0ab2647a SDL_test: print no procname when SDL_TRACKMEM_SYMBOL_NAMES is false
On ci, by default this variable is set to a false value.
By adding [sdl-ci-trackmem] to the commit message,
it will become true.
2024-08-31 13:16:51 +02:00
Anonymous Maarten
384afa378c SDL_test: fix proc names on older libunwind
Older libunwind does not have unw_get_proc_name_by_ip.
Instead, use unw_get_proc_name.

Reference: 4c00433b69
2024-08-31 13:16:51 +02:00
Andrei Alexeyev
0e08d15cca
GPU: Fix unhandled R16G16_UNORM in SDL_GPUTextureFormatTexelBlockSize() (#10638) 2024-08-30 17:05:17 -07:00
Sam Lantinga
f13dc502c6 Sort exported functions 2024-08-30 15:45:30 -07:00
Evan Hemsley
12ecdb9dde
GPU: Rename some awkwardly named functions (#10642) 2024-08-30 15:31:10 -07:00
Sam Lantinga
bef07023d6 Fixed memory leak if the GPU renderer can't be initialized
DestroyRenderer needs to be set before we return false from GPU_CreateRenderer()
2024-08-30 14:49:49 -07:00
cosmonaut
906044569d GPU D3D12: Fix command buffer leak 2024-08-30 10:46:41 -07:00
Sam Lantinga
b602c449e5 Remove SDL_SCALEMODE_BEST
Fixes https://github.com/libsdl-org/SDL/issues/10619
2024-08-30 10:30:14 -07:00
Evan Hemsley
4bbf0d45fd
GPU D3D12: Fix teardown and leaks on device creation failure (#10639) 2024-08-30 10:24:02 -07:00
Sam Lantinga
40d85109ac Fixed crash when using the dummy video driver
The higher level code will clean up the renderer if initialization fails.
2024-08-30 07:16:47 -07:00
Sam Lantinga
580a496391 Adjust rounding when calculating resampled output frames
Fixes https://github.com/libsdl-org/sdl2-compat/issues/95
2024-08-30 07:16:47 -07:00
Anonymous Maarten
88fe52df7b SDL_test: add --gpu option 2024-08-30 13:43:38 +02:00
Andrei Alexeyev
d1a2c57fb9
GPU: Fix memory leak in VULKAN_CreateDevice (#10631) 2024-08-29 22:15:08 -07:00
Sam Lantinga
16fb8e54cb Fixed the colorspace for YUV textures using native RGB representations
Fixes https://github.com/libsdl-org/SDL/issues/10624
2024-08-29 20:55:09 -07:00
Sam Lantinga
efc98062af Fixed warning C4310: cast truncates constant value 2024-08-29 19:31:23 -07:00
Sam Lantinga
5518aca054 Use stdbool internally in SDL 2024-08-29 18:54:05 -07:00
Sam Lantinga
dfcabc3db8 Fixed drawing debug text 2024-08-29 18:21:48 -07:00
Sam Lantinga
683e5b8d52 Removed Unicode BOM 2024-08-29 17:33:52 -07:00
Sam Lantinga
858589919a Temporarily use the GPU renderer by default so we get testing feedback 2024-08-29 17:33:52 -07:00
Sam Lantinga
b356c65005 Sort exported symbols 2024-08-29 17:33:52 -07:00
Sam Lantinga
62f6e6b701 Removed the preferLowPower parameter from SDL_CreateGPUDevice() 2024-08-29 17:33:52 -07:00
Sam Lantinga
b8e7ef27f3 Renamed GPU device creation properties 2024-08-29 17:33:52 -07:00
Sam Lantinga
d70578b9aa Renamed Gpu to GPU 2024-08-29 17:33:52 -07:00
cosmonaut
2e7d5bb429 Add the SDL_GPU API
Project Lead: Evan Hemsley <evan@moonside.games>

Co-designer, Metal Port, Console Ports:

Co-authored-by: Caleb Cornett <caleb.cornett@outlook.com>

Production, QA, Debug:

Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>

SDL_Render Driver, Bugfixes:

Co-authored-by: Andrei Alexeyev <akari@taisei-project.org>

Additional D3D12 Programming, Bugfixes:

Co-authored-by: Bart van der Werf <bluelive@gmail.com>

Bugfixes and Feedback:

Co-authored-by: Zakary Strange <zakarystrange@gmail.com>
Co-authored-by: meyraud705 <meyraud705@gmail.com>
Co-authored-by: Joshua T. Fisher <playmer@gmail.com>
Co-authored-by: Topi Ritala <ritalat@fastmail.com>
Co-authored-by: David Gow <david@ingeniumdigital.com>

Original API Proposal:

Co-authored-by: Ryan C. Gordon <icculus@icculus.org>
2024-08-29 15:57:29 -07:00
Mārtiņš Možeiko
d9b3b9ad91 Add neon SIMD alpha blending blitter 2024-08-28 21:37:55 -07:00
Ethan Lee
9ab140fad8 offscreen: Fix bogus surface pointer assignment 2024-08-28 21:31:24 -04:00
Sam Lantinga
1a007ab88d Fixed SDL_GetDisplayIndex() 2024-08-28 16:30:21 -07:00
Sam Lantinga
7055001d85 Fixed SDL_GetPrimaryDisplay() 2024-08-28 15:59:13 -07:00
Sam Lantinga
0cdb4833d5 Removed unnecessary inclusion of stdint.h 2024-08-28 15:54:56 -07:00
Sam Lantinga
37b4aac3ac Removed unnecessary inclusion of stdbool.h 2024-08-28 13:58:03 -07:00
Sam Lantinga
91eabf1b4d Fixed SDL_EGL_ChooseConfig() 2024-08-28 13:37:00 -07:00
Sam Lantinga
3bf7b4ff31 Fixed SDL_EGL_LoadLibrary() 2024-08-28 13:21:02 -07:00
Mārtiņš Možeiko
8d65942b9c Faster sse4 and avx2 SIMD blitters 2024-08-28 10:40:44 -07:00
Sam Lantinga
c4b35488c2 Fixed warning C6385: Reading invalid data from 'one_blitkey'. 2024-08-28 10:40:14 -07:00
Sam Lantinga
abd8ea09de Fixed warning C6001: Using uninitialized memory 'devices'. 2024-08-28 10:34:34 -07:00
Sam Lantinga
ace6920d44 Fixed returning -1 in a function returning bool 2024-08-27 22:35:09 -07:00
Ryan C. Gordon
5dc5b4b83c
pthread: Fixed logic bug in SDL_WaitConditionTimeoutNS due to boolization work. 2024-08-27 17:00:47 -04:00
Sam Lantinga
47926d7bd0 Added a cleanup function for virtual joysticks 2024-08-27 10:31:46 -07:00
Sam Lantinga
00c409cff8 Additional cleanup exposed by building with a C++ compiler 2024-08-27 10:31:46 -07:00
Sam Lantinga
f08ac438ed Use stdbool for SDL_bool
This helps the compiler warn people when they're doing something like "if (SDL_Init(0) < 0)"
2024-08-27 10:31:46 -07:00
Sam Lantinga
9ff3446f03 Use SDL_bool instead an int return code in the SDL API
Most SDL functions used to indicate success or failure using an int return code. These functions have been changed to return SDL_bool.

Here is a coccinelle patch to change code that previously compared the return value to 0 and changes it to a boolean test:
@ bool_return_type  @
identifier func =~ "^(SDL_AddEventWatch|SDL_AddHintCallback|SDL_AddSurfaceAlternateImage|SDL_AddVulkanRenderSemaphores|SDL_BindAudioStream|SDL_BindAudioStreams|SDL_BlitSurface|SDL_BlitSurface9Grid|SDL_BlitSurfaceScaled|SDL_BlitSurfaceTiled|SDL_BlitSurfaceTiledWithScale|SDL_BlitSurfaceUnchecked|SDL_BlitSurfaceUncheckedScaled|SDL_CaptureMouse|SDL_ClearAudioStream|SDL_ClearClipboardData|SDL_ClearComposition|SDL_ClearError|SDL_ClearProperty|SDL_ClearSurface|SDL_CloseIO|SDL_CloseStorage|SDL_ConvertAudioSamples|SDL_ConvertEventToRenderCoordinates|SDL_ConvertPixels|SDL_ConvertPixelsAndColorspace|SDL_CopyFile|SDL_CopyProperties|SDL_CopyStorageFile|SDL_CreateDirectory|SDL_CreateStorageDirectory|SDL_CreateWindowAndRenderer|SDL_DateTimeToTime|SDL_DestroyWindowSurface|SDL_DetachVirtualJoystick|SDL_DisableScreenSaver|SDL_EnableScreenSaver|SDL_EnumerateDirectory|SDL_EnumerateProperties|SDL_EnumerateStorageDirectory|SDL_FillSurfaceRect|SDL_FillSurfaceRects|SDL_FlashWindow|SDL_FlipSurface|SDL_FlushAudioStream|SDL_FlushRenderer|SDL_GL_DestroyContext|SDL_GL_GetAttribute|SDL_GL_GetSwapInterval|SDL_GL_LoadLibrary|SDL_GL_MakeCurrent|SDL_GL_SetAttribute|SDL_GL_SetSwapInterval|SDL_GL_SwapWindow|SDL_GetAudioDeviceFormat|SDL_GetAudioStreamFormat|SDL_GetCameraFormat|SDL_GetClosestFullscreenDisplayMode|SDL_GetCurrentRenderOutputSize|SDL_GetCurrentTime|SDL_GetDXGIOutputInfo|SDL_GetDateTimeLocalePreferences|SDL_GetDisplayBounds|SDL_GetDisplayUsableBounds|SDL_GetGDKDefaultUser|SDL_GetGDKTaskQueue|SDL_GetGamepadSensorData|SDL_GetGamepadTouchpadFinger|SDL_GetHapticEffectStatus|SDL_GetJoystickBall|SDL_GetMasksForPixelFormat|SDL_GetPathInfo|SDL_GetRectUnion|SDL_GetRectUnionFloat|SDL_GetRenderClipRect|SDL_GetRenderColorScale|SDL_GetRenderDrawBlendMode|SDL_GetRenderDrawColor|SDL_GetRenderDrawColorFloat|SDL_GetRenderLogicalPresentation|SDL_GetRenderLogicalPresentationRect|SDL_GetRenderOutputSize|SDL_GetRenderSafeArea|SDL_GetRenderScale|SDL_GetRenderVSync|SDL_GetRenderViewport|SDL_GetSensorData|SDL_GetStorageFileSize|SDL_GetStoragePathInfo|SDL_GetSurfaceAlphaMod|SDL_GetSurfaceBlendMode|SDL_GetSurfaceClipRect|SDL_GetSurfaceColorKey|SDL_GetSurfaceColorMod|SDL_GetTextInputArea|SDL_GetTextureAlphaMod|SDL_GetTextureAlphaModFloat|SDL_GetTextureBlendMode|SDL_GetTextureColorMod|SDL_GetTextureColorModFloat|SDL_GetTextureScaleMode|SDL_GetTextureSize|SDL_GetWindowAspectRatio|SDL_GetWindowBordersSize|SDL_GetWindowMaximumSize|SDL_GetWindowMinimumSize|SDL_GetWindowPosition|SDL_GetWindowRelativeMouseMode|SDL_GetWindowSafeArea|SDL_GetWindowSize|SDL_GetWindowSizeInPixels|SDL_GetWindowSurfaceVSync|SDL_HideCursor|SDL_HideWindow|SDL_Init|SDL_InitHapticRumble|SDL_InitSubSystem|SDL_LoadWAV|SDL_LoadWAV_IO|SDL_LockAudioStream|SDL_LockProperties|SDL_LockSurface|SDL_LockTexture|SDL_LockTextureToSurface|SDL_MaximizeWindow|SDL_MinimizeWindow|SDL_MixAudio|SDL_OpenURL|SDL_OutOfMemory|SDL_PauseAudioDevice|SDL_PauseAudioStreamDevice|SDL_PauseHaptic|SDL_PlayHapticRumble|SDL_PremultiplyAlpha|SDL_PremultiplySurfaceAlpha|SDL_PushEvent|SDL_PutAudioStreamData|SDL_RaiseWindow|SDL_ReadStorageFile|SDL_ReadSurfacePixel|SDL_ReadSurfacePixelFloat|SDL_RegisterApp|SDL_ReloadGamepadMappings|SDL_RemovePath|SDL_RemoveStoragePath|SDL_RemoveTimer|SDL_RenamePath|SDL_RenameStoragePath|SDL_RenderClear|SDL_RenderCoordinatesFromWindow|SDL_RenderCoordinatesToWindow|SDL_RenderFillRect|SDL_RenderFillRects|SDL_RenderGeometry|SDL_RenderGeometryRaw|SDL_RenderLine|SDL_RenderLines|SDL_RenderPoint|SDL_RenderPoints|SDL_RenderPresent|SDL_RenderRect|SDL_RenderRects|SDL_RenderTexture|SDL_RenderTexture9Grid|SDL_RenderTextureRotated|SDL_RenderTextureTiled|SDL_RequestAndroidPermission|SDL_RestoreWindow|SDL_ResumeAudioDevice|SDL_ResumeAudioStreamDevice|SDL_ResumeHaptic|SDL_RumbleGamepad|SDL_RumbleGamepadTriggers|SDL_RumbleJoystick|SDL_RumbleJoystickTriggers|SDL_RunHapticEffect|SDL_SaveBMP|SDL_SaveBMP_IO|SDL_SendAndroidMessage|SDL_SendGamepadEffect|SDL_SendJoystickEffect|SDL_SendJoystickVirtualSensorData|SDL_SetAppMetadata|SDL_SetAppMetadataProperty|SDL_SetAudioDeviceGain|SDL_SetAudioPostmixCallback|SDL_SetAudioStreamFormat|SDL_SetAudioStreamFrequencyRatio|SDL_SetAudioStreamGain|SDL_SetAudioStreamGetCallback|SDL_SetAudioStreamInputChannelMap|SDL_SetAudioStreamOutputChannelMap|SDL_SetAudioStreamPutCallback|SDL_SetBooleanProperty|SDL_SetClipboardData|SDL_SetClipboardText|SDL_SetCursor|SDL_SetFloatProperty|SDL_SetGamepadLED|SDL_SetGamepadMapping|SDL_SetGamepadPlayerIndex|SDL_SetGamepadSensorEnabled|SDL_SetHapticAutocenter|SDL_SetHapticGain|SDL_SetJoystickLED|SDL_SetJoystickPlayerIndex|SDL_SetJoystickVirtualAxis|SDL_SetJoystickVirtualBall|SDL_SetJoystickVirtualButton|SDL_SetJoystickVirtualHat|SDL_SetJoystickVirtualTouchpad|SDL_SetLinuxThreadPriority|SDL_SetLinuxThreadPriorityAndPolicy|SDL_SetLogPriorityPrefix|SDL_SetMemoryFunctions|SDL_SetNumberProperty|SDL_SetPaletteColors|SDL_SetPointerProperty|SDL_SetPointerPropertyWithCleanup|SDL_SetPrimarySelectionText|SDL_SetRenderClipRect|SDL_SetRenderColorScale|SDL_SetRenderDrawBlendMode|SDL_SetRenderDrawColor|SDL_SetRenderDrawColorFloat|SDL_SetRenderLogicalPresentation|SDL_SetRenderScale|SDL_SetRenderTarget|SDL_SetRenderVSync|SDL_SetRenderViewport|SDL_SetScancodeName|SDL_SetStringProperty|SDL_SetSurfaceAlphaMod|SDL_SetSurfaceBlendMode|SDL_SetSurfaceColorKey|SDL_SetSurfaceColorMod|SDL_SetSurfaceColorspace|SDL_SetSurfacePalette|SDL_SetSurfaceRLE|SDL_SetTLS|SDL_SetTextInputArea|SDL_SetTextureAlphaMod|SDL_SetTextureAlphaModFloat|SDL_SetTextureBlendMode|SDL_SetTextureColorMod|SDL_SetTextureColorModFloat|SDL_SetTextureScaleMode|SDL_SetThreadPriority|SDL_SetWindowAlwaysOnTop|SDL_SetWindowAspectRatio|SDL_SetWindowBordered|SDL_SetWindowFocusable|SDL_SetWindowFullscreen|SDL_SetWindowFullscreenMode|SDL_SetWindowHitTest|SDL_SetWindowIcon|SDL_SetWindowKeyboardGrab|SDL_SetWindowMaximumSize|SDL_SetWindowMinimumSize|SDL_SetWindowModalFor|SDL_SetWindowMouseGrab|SDL_SetWindowMouseRect|SDL_SetWindowOpacity|SDL_SetWindowPosition|SDL_SetWindowRelativeMouseMode|SDL_SetWindowResizable|SDL_SetWindowShape|SDL_SetWindowSize|SDL_SetWindowSurfaceVSync|SDL_SetWindowTitle|SDL_SetiOSAnimationCallback|SDL_ShowAndroidToast|SDL_ShowCursor|SDL_ShowMessageBox|SDL_ShowSimpleMessageBox|SDL_ShowWindow|SDL_ShowWindowSystemMenu|SDL_StartTextInput|SDL_StartTextInputWithProperties|SDL_StopHapticEffect|SDL_StopHapticEffects|SDL_StopHapticRumble|SDL_StopTextInput|SDL_SyncWindow|SDL_TimeToDateTime|SDL_TryLockMutex|SDL_TryLockRWLockForReading|SDL_TryLockRWLockForWriting|SDL_TryWaitSemaphore|SDL_UnlockAudioStream|SDL_UpdateHapticEffect|SDL_UpdateNVTexture|SDL_UpdateTexture|SDL_UpdateWindowSurface|SDL_UpdateWindowSurfaceRects|SDL_UpdateYUVTexture|SDL_Vulkan_CreateSurface|SDL_Vulkan_LoadLibrary|SDL_WaitConditionTimeout|SDL_WaitSemaphoreTimeout|SDL_WarpMouseGlobal|SDL_WriteStorageFile|SDL_WriteSurfacePixel|SDL_WriteSurfacePixelFloat)$";
@@
(
  func(
  ...
  )
- == 0
|
- func(
+ !func(
  ...
  )
- < 0
|
- func(
+ !func(
  ...
  )
- != 0
|
- func(
+ !func(
  ...
  )
- == -1
)
2024-08-27 10:31:46 -07:00
Caleb Cornett
d9a5ed75b9 GDK: Xbox should have input focus by default 2024-08-25 22:12:02 -04:00
Ryan C. Gordon
d118af53a1
dummyaudio: single-threaded Emscripten support.
On Emscripten without pthreads, this would fail because SDL can't spin the
audio device thread, and the dummy backend didn't manage a thread itself.

With this patch, we use setInterval to fire the usual audio thread iterators
between iterations of the Emscripten mainloop on the main thread.

Fixes #10573.
2024-08-25 15:23:21 -04:00
Ozkan Sezer
845212388e RAWINPUT_JoystickOpen: add missing SDL_stack_free() calls.
Fixes https://github.com/libsdl-org/SDL/issues/10574.
2024-08-25 11:05:40 +03:00
Francisco Javier Trujillo Mata
aa527dd0c2 Allow MessageBox to work without window 2024-08-23 11:52:19 -07:00
Sam Lantinga
fa2c9c46c5 Default SDL_HINT_JOYSTICK_GAMEINPUT to SDL_FALSE
This was causing crashes in IGameInput_RegisterSystemButtonCallback(), presumably on older systems with runtimes using a different function signature. We'll just disable it for now until the GameInput runtime has stabilized and we can tell when it's safe to use.
2024-08-23 11:34:15 -07:00
Anonymous Maarten
c298d2024a Include SDL_build_config.h without a 'build_config/' prefix 2024-08-23 00:51:35 +00:00
Sam Lantinga
3e60fb4223 VULKAN_UpdateVertexBuffer() should return true if there's nothing to do 2024-08-22 13:30:02 -07:00
Sam Lantinga
8f546bb3c9 Use C99 bool internally in SDL 2024-08-22 13:30:02 -07:00
Sam Lantinga
6501e90018 Use C++ style comments consistently in SDL source code
Implemented using this script:

find . -type f -exec sed -i'' -e 's,/\* *\([^*]*\)\*/ *$,// \1,' -e 's, \+$,,' {} \;
git checkout \
    core/linux/SDL_evdev_kbd_default_keymap.h \
    events/imKStoUCS.* \
    hidapi \
    joystick/controller_type.c \
    joystick/controller_type.h \
    joystick/hidapi/steam/controller_constants.h \
    joystick/hidapi/steam/controller_structs.h \
    joystick/SDL_gamepad_db.h \
    libm \
    render/*/*Shader*.h \
    render/vitagxm/SDL_render_vita_gxm_shaders.h \
    render/metal/SDL_shaders_metal_*.h \
    stdlib/SDL_malloc.c \
    stdlib/SDL_qsort.c \
    stdlib/SDL_strtokr.c \
    test/ \
    video/directx/SDL_d3d12_xbox_cmacros.h \
    video/directx/d3d12.h \
    video/directx/d3d12sdklayers.h \
    video/khronos \
    video/x11/edid-parse.c \
    video/x11/xsettings-client.* \
    video/yuv2rgb
sed -i'' -e 's,/\* *\([^*]*\)\*/ *$,// \1,' -e 's, \+$,,' hidapi/SDL_hidapi.c
2024-08-22 13:30:02 -07:00
Sam Lantinga
037541a0e0 Check standard error code return values as < 0 instead of == -1 2024-08-22 09:04:30 -07:00
Anonymous Maarten
46d9066a69 Fix warnings shown when making SDL_bool a typedef of bool 2024-08-22 16:03:39 +00:00
Anonymous Maarten
29ca5b5dcd SDLTest_CompareMemory: print header 2024-08-20 16:04:58 +00:00
Sam Lantinga
61b024766a Fixed crash when quitting after a joystick has been disconnected on Android
Fixes https://github.com/libsdl-org/SDL/issues/10567
2024-08-20 07:26:09 -07:00
Ryan C. Gordon
423d6ec15a
emscripten: Make sure SDL_malloc and friends are marked KEEPALIVE.
Reference PR #9937.
2024-08-19 23:50:52 -04:00
Sam Lantinga
e75175129f Added support for the Retro-bit Controller in PS3 mode
Fixes https://github.com/libsdl-org/SDL/issues/10557
2024-08-19 16:40:50 -07:00
Jan Engelhardt
92c4734666 Resolve build failures in pipewire code
g++-13 complains:

```
SDL_pipewire.c:129:42: warning: assignment to "struct pw_main_loop *
(*)(struct pw_main_loop *)" from incompatible pointer type "struct
pw_main_loop * (*)(const struct spa_dict *)"
[-Wincompatible-pointer-types]
 129 | #define SDL_PIPEWIRE_SYM(x) PIPEWIRE_##x = x
SDL_pipewire.c:148:5: note: in expansion of macro "SDL_PIPEWIRE_SYM"
 148 |     SDL_PIPEWIRE_SYM(pw_main_loop_new);
```

g++-14 complains:

```
SDL_pipewire.c:129:42: error: assignment to "struct pw_main_loop *
(*)(const struct pw_main_loop *)" from incompatible pointer type
"struct pw_main_loop * (*)(const struct spa_dict *)"
[-Wincompatible-pointer-types]
```
2024-08-19 14:26:08 -07:00
Ryan C. Gordon
405693175d
camera: Fixed Emscripten support. 2024-08-19 14:15:47 -04:00
Ryan C. Gordon
9c5bd98a0f
assert: Added SDL_HINT_ASSERT.
Same environment variable, but now accessible as a formal SDL hint.

Reference PR #10171.
2024-08-18 20:53:55 -04:00
Sam Lantinga
59ac561062 PSP: Throw SDL_EVENT_QUIT event upon exit (thanks @sharkwouter!)
Closes https://github.com/libsdl-org/SDL/pull/10565
2024-08-18 08:25:44 -07:00
ds-sloth
7d78835f87
SDL_iostream.c: stdio_seek - skip API call for SEEK_CUR with 0 offset
Fixes #10556.
2024-08-16 17:13:49 -04:00
Sam Lantinga
438a214420 Changed main callback return values to an enumeration
Fixes https://github.com/libsdl-org/SDL/issues/10515
2024-08-16 11:16:05 -07:00
Sam Lantinga
83adcb9d38 Added SDL_PROP_WINDOW_CREATE_FLAGS_NUMBER
This is undocumented since the individual flags are separate window creation properties, but it's useful to have a shared definition for this, which is used internally and for migrating code from SDL2.
2024-08-15 13:33:06 -07:00
Sam Lantinga
d7b027a241 Namespace the object creation properties
Fixes https://github.com/libsdl-org/SDL/issues/10543
2024-08-15 12:56:04 -07:00
Sam Lantinga
8e99ec34bb Use drmModeAddFB() if drmModeAddFB2WithModifiers() fails
Fixes https://github.com/libsdl-org/SDL/issues/10276
2024-08-15 11:51:46 -07:00
Sam Lantinga
41f1c83caa If scaling fails, fall back to the closest image available in SDL_GetSurfaceImage() 2024-08-15 07:38:43 -07:00
Kaktus514
3586df3151 Prefer downscaling in SDL_GetSurfaceImage.
This implements the ideas described in  #10536
2024-08-15 07:28:31 -07:00
Anonymous Maarten
612b41c451 camera: use cdevice SDL_Event union member 2024-08-15 09:20:34 -04:00
Sam Lantinga
efdcfef4b9 Fixed Android build warnings 2024-08-13 10:52:50 -07:00
Ilya Mizus
ce98550cbb
Fixed secondary screens on KMSDRM (#10535)
* Removed window movement to left top corner that breaks secondary screens on KMSDRM
2024-08-13 07:15:12 -07:00