Commit Graph

11075 Commits

Author SHA1 Message Date
Ryan C. Gordon
045f0456b1 dummyvideo: Change a thing using int to use SDL_bool instead. 2024-07-16 14:15:38 -04:00
Sam Lantinga
027671bedb SDL_GetWindowOpacity() directly returns the opacity instead of using an out parameter.
Fixes https://github.com/libsdl-org/SDL/issues/10286
2024-07-16 09:36:11 -07:00
Sam Lantinga
58270ef3f2 Finished renaming functions in SDL_system.h 2024-07-16 09:35:49 -07:00
Sam Lantinga
033df70d4c SDL_DelayNS() will attempt to sleep exactly the requested amount of time
This provides a highly accurate sleep function for your application, although you are still subject to being switched out occasionally.

Fixes https://github.com/libsdl-org/SDL/issues/10210
2024-07-15 18:38:09 -07:00
Sam Lantinga
54366181c3 Rename functions in SDL_system.h to match SDL 3.0 naming convention
Fixes https://github.com/libsdl-org/SDL/issues/10277
2024-07-15 16:27:48 -07:00
Sam Lantinga
492e3c1a54 direct3d11: we don't need to create all the blend states up front 2024-07-15 14:12:33 -07:00
Sam Lantinga
df573391b1 Added SDL_BLENDMODE_BLEND_PREMULTIPLIED and SDL_BLENDMODE_ADD_PREMULTIPLIED
Fixes https://github.com/libsdl-org/SDL/issues/2485
2024-07-15 14:12:33 -07:00
Carl Åstholm
f099898a66 Correct ibus include path
ibus-1.0.pc adds /usr/include/ibus-1.0 to the search path but not
/usr/include, which makes the canonical include path <ibus.h>.
2024-07-15 11:24:47 -07:00
Sam Lantinga
5c875e1183 Renamed *FromID() to *ForID()
While it makes sense to get an object pointer from an object ID, you want to get object attributes for an ID, otherwise e.g. GetNameFromID() sounds like it's a name ID, not an object ID. This is also consistent with the function naming convention in SDL2.
2024-07-14 15:56:50 -07:00
Sam Lantinga
5836b880b4 Sorted symbols 2024-07-14 13:01:53 -07:00
Sam Lantinga
9797c5d0c0 Renamed CameraDevice to Camera
This is consistent with the rest of the SDL API
2024-07-14 13:01:53 -07:00
Sam Lantinga
9358333286 Renamed SDL_GetKeyboardInstanceName() and SDL_GetMouseInstanceName()
For consistency with other device APIs
2024-07-14 13:01:53 -07:00
Sam Lantinga
d154b37b41 Renamed *FromInstanceID() to *FromID() 2024-07-14 13:01:53 -07:00
Sam Lantinga
e90060d07f Renamed functions to get information from device IDs
Fixes https://github.com/libsdl-org/SDL/issues/10237
2024-07-14 09:03:59 -07:00
Anonymous Maarten
933f2fc239 pthread: timespec.tv_nsec must be less then 1000000000 ns 2024-07-14 17:28:54 +02:00
Sam Lantinga
bfee544685 Changed SDL_GetWindowPixelFormat() to return SDL_PixelFormat
Fixes https://github.com/libsdl-org/SDL/issues/10257
Closes https://github.com/libsdl-org/SDL/pull/10258
2024-07-14 07:19:20 -07:00
Sam Lantinga
509f3a42d7 Fixed crash when pumping events after the window has been destroyed on Android 2024-07-13 17:57:46 -07:00
Anonymous Maarten
c80665a696 Avoid code duplication in SDL_GetPixelFormatDetails 2024-07-14 01:20:02 +02:00
pixls
4e3f35ccbf Unlocking mutex in success case too
Without unlocking, we trigger an assertion failure in SDL_sysmutex.c at line 80 (i.e. 'rc == 0'). Each lock-unlock pair should ideally cancel each other out, maintaining a reference count that returns to zero.
2024-07-13 16:12:46 -07:00
Sam Lantinga
650271af46 Added SDL_CreateSurfacePalette() 2024-07-13 14:31:28 -07:00
Sam Lantinga
9379e2eb8d Don't force vsync on for the software renderer
Setting vsync 0 should succeed for the software renderer.
2024-07-13 10:04:15 -07:00
Sam Lantinga
1e6119e335 VULKAN_RenderPresent() should return result code 0 on success 2024-07-13 09:27:06 -07:00
Ryan C. Gordon
3d86dce673 haiku: No more chdir to executable's directory at startup in SDL3.
Use SDL_GetBaseDir() to find this directory instead.

Reference Issue #8403.
Fixes #7596.
2024-07-13 12:24:27 -04:00
Sam Lantinga
c6b9b08e9f Fixed Android build warnings 2024-07-13 09:00:41 -07:00
Sam Lantinga
44f06b216a Fixed refresh interval calculation 2024-07-13 08:52:43 -07:00
captain0xff
2dcb9440f1 android: fix the vulkan renderer 2024-07-13 08:16:26 -07:00
ceski
68cf17d0d4 Add a Windows mapping for SplitFish Game Controller 2024-07-12 19:48:40 -07:00
Sam Lantinga
00ab330207 Use DXGI to get precise display mode refresh rate values
Fixes https://github.com/libsdl-org/SDL/issues/10185
2024-07-12 19:45:01 -07:00
Sam Lantinga
730d5cf2f8 Added fractional representation of refresh rate to SDL_DisplayMode 2024-07-12 18:09:14 -07:00
Sam Lantinga
1162a1cb8e Added SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED and SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED 2024-07-12 18:09:14 -07:00
Ryan C. Gordon
8779c95905 android: Added SDL_AndroidGetCachePath().
Fixes #8408.
2024-07-12 15:41:54 -04:00
Frank Praznik
be15d4ae1f wayland: Add support for SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH behavior
Previously, the Wayland backend did not implement support for this hint and always passed focus clicks through. Obey the hint to match the behavior of other platforms.
2024-07-12 13:58:20 -04:00
Sam Lantinga
5bf6bc4d7d Renamed SDL_Get/SetProperty() to SDL_Get/SetPointerProperty()
This is consistent with the naming for the functions that affect other data types

Fixes https://github.com/libsdl-org/SDL/issues/10241
2024-07-12 10:41:02 -07:00
Sam Lantinga
bd041b4831 Make sure SDL subsystems are initialized before starting threads 2024-07-12 09:10:05 -07:00
Sam Lantinga
bafbbbf7dd Fixed V4L2 framerate request
V4L2 uses time interval instead of framerate

Fixes https://github.com/libsdl-org/SDL/issues/10234
2024-07-12 06:47:34 -07:00
Ethan Lee
180b4d7e74 x11: Fix a bogus return in Vulkan_GetPresentationSupport 2024-07-11 21:50:37 -04:00
Sam Lantinga
f4f4b453de Sorted API entry points 2024-07-11 12:16:35 -07:00
Sam Lantinga
b517043936 Added TLS initialization and shutdown functions
Fixes https://github.com/libsdl-org/SDL/issues/8576
2024-07-11 12:11:01 -07:00
Ethan Lee
8d24bb8dfc video: Added parameter checks to SDL_Vulkan_GetPresentationSupport 2024-07-11 15:00:59 -04:00
Ethan Lee
1993ef664e Add SDL_Vulkan_GetPresentationSupport 2024-07-11 15:00:59 -04:00
Frank Praznik
186fec2560 pipewire: Consolidate registry enumeration instances
The preferred Pipewire path requires both devices being available, and that a sufficiently recent underlying core version is running on the host system. These criteria were being checked separately, which required two separate instances of enumerating the Pipewire registry, which is a fairly heavy operation. Move the version info callback to the main hotplug thread to avoid enumerating the registry twice, and check for both the version and required devices at the same time on the preferred path.
2024-07-11 14:14:15 -04:00
Ozkan Sezer
f437fe75f2 SDL_dynapi_overrides.h: remove left-over SDL_DestroyPixelFormat entry. 2024-07-11 18:56:40 +03:00
Sam Lantinga
875c4f0a4c Support indexed surfaces without palettes (thanks @sulix!)
Currently, all SDL_Surfaces with an indexed pixel format have an
associated SDL_Palette. This palette either consists of entirely the
colour black, or -- in the special case of 1-bit surfaces, black and
white.

When an indexed surface is blitted to another indexed surface, a 'map'
is generated from the source surface's palette to the destination
surfaces palette, in order to preserve the look of the image if the
palettes differ.

However, in most cases, applications will want to blit the raw index
values, rather than translate to make the colours as similar as
possible. For instance, the destination surface's palette may have been
modified to fade the screen out.

This change allows an indexed surface to have no associated palette. If
either the source or destination surface of a blit do not have a
palette, then the raw indices are copied (assuming both have an indexed
format).

This mimics better what happens with most other APIs (such as
DirectDraw), where most users do not set a palette on any surface but
the screen, whose palette is implicitly used for the whole application.
2024-07-11 08:31:32 -07:00
Anonymous Maarten
83d4251540 hidapi: netbsd's iconv expects a 'char ** restrict src' 2024-07-11 08:12:42 -07:00
Anonymous Maarten
131108ee48 Remove references to SDL_CreatePixelFormat and SDL_DestroyPixelFormat 2024-07-11 08:12:42 -07:00
Sam Lantinga
0b2c80557c Update the blit mapping when the palette is set on a surface
Make sure you do this even if the palette pointer hasn't changed, as the contents may have.

Fixes https://github.com/libsdl-org/SDL/issues/10225
2024-07-10 23:22:06 -07:00
Giovanni Petrantoni
a16ff651e8 Set Fixed Scale Factor for VisionOS (#10222) 2024-07-10 21:56:50 -07:00
Sam Lantinga
9e331d235f Fixed the return value of SDL_Vulkan_CreateSurface() on the Vivante platform 2024-07-10 20:32:47 -07:00
Sam Lantinga
5ee88d43f9 Fixed mapping the non-US hash key on European keyboards 2024-07-10 20:13:40 -07:00
Sam Lantinga
8722c297a4 Added a key name for the non-US backslash key 2024-07-10 19:16:04 -07:00