Commit Graph

2820 Commits

Author SHA1 Message Date
Sam Lantinga
a17b742e34 Added documentation references to the components of a colorspace 2024-07-14 11:43:39 -07:00
SDL Wiki Bot
abaef81615 Sync SDL3 wiki -> header 2024-07-14 18:04:00 +00:00
Sam Lantinga
6217094c40 Updated colorspace documentation for the wiki 2024-07-14 11:02:56 -07:00
Sam Lantinga
1fecef5e4b Assign numeric values to pixel format enums
This makes it easier to generate language bindings for these.
2024-07-14 11:02:56 -07:00
Sam Lantinga
cb395f7e80 Change SDL_AudioFormat into an enum
This makes it easier to understand in the debugger, and is consistent with SDL_PixelFormat and SDL_Colorspace
2024-07-14 10:04:31 -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
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
SDL Wiki Bot
2596482c3f Sync SDL3 wiki -> header 2024-07-13 21:32:39 +00:00
Sam Lantinga
650271af46 Added SDL_CreateSurfacePalette() 2024-07-13 14:31:28 -07:00
captain0xff
0506cf18ab android: enable vulkan renderer 2024-07-13 08:16:26 -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
SDL Wiki Bot
3f446a12df Sync SDL3 wiki -> header 2024-07-12 19:42:55 +00:00
Ryan C. Gordon
8779c95905 android: Added SDL_AndroidGetCachePath().
Fixes #8408.
2024-07-12 15:41:54 -04:00
SDL Wiki Bot
d949673bc9 Sync SDL3 wiki -> header 2024-07-12 18:25:57 +00:00
Sam Lantinga
4c88ddf86d More property documentation clarification 2024-07-12 11:24:40 -07:00
SDL Wiki Bot
cf441332c4 Sync SDL3 wiki -> header 2024-07-12 18:21:05 +00:00
Sam Lantinga
0e56f6a3ca Clarify property group documentation
Fixes https://github.com/libsdl-org/SDL/issues/10241
2024-07-12 11:20:15 -07:00
SDL Wiki Bot
d6fe06bb5d Sync SDL3 wiki -> header 2024-07-12 17:42:22 +00: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
Ryan C. Gordon
bf03dee866
Remove struct SDL_Camera predeclare.
This is unnecessary and confuses the wiki bridge.
2024-07-12 13:25:06 -04:00
SDL Wiki Bot
f531003776 Sync SDL3 wiki -> header 2024-07-12 15:37:23 +00:00
SDL Wiki Bot
68dfae1322 Sync SDL3 wiki -> header 2024-07-12 15:35:05 +00:00
Sam Lantinga
282cf286fc SDL_GetPixelFormatName() returns a string 2024-07-12 05:59:45 -07:00
SDL Wiki Bot
50589cbff6 Sync SDL3 wiki -> header 2024-07-12 12:33:26 +00:00
SDL Wiki Bot
f0ceb92dca Sync SDL3 wiki -> header 2024-07-11 19:01:27 +00:00
Ethan Lee
1993ef664e Add SDL_Vulkan_GetPresentationSupport 2024-07-11 15:00:59 -04:00
Ryan C. Gordon
af2dbf3ff3 video: Rename SDL_GL_DeleteContext to SDL_GL_DestroyContext.
Turns out that there isn't a strong OpenGL naming convention for "Delete" ...
WGL offers "wglDeleteContext" but the GLX equivalent is "glxDestroyContext"
and then EGL sealed the deal by going with Destroy as well! Since it matches
SDL3 naming conventions (Create/Destroy), we're renaming it.

Fixes #10197.
2024-07-10 15:54:08 -04:00
SDL Wiki Bot
29b0076659 Sync SDL3 wiki -> header 2024-07-10 19:45:01 +00:00
Ryan C. Gordon
4755055bc3 audio: Separate channel maps out of SDL_AudioSpec. 2024-07-10 15:43:57 -04:00
SDL Wiki Bot
fdc04708f1 Sync SDL3 wiki -> header 2024-07-10 07:48:48 +00:00
Sam Lantinga
2ba76dbe80 Simplified SDL_Surface
SDL_Surface has been simplified and internal details are no longer in the public structure.

The `format` member of SDL_Surface is now an enumerated pixel format value. You can get the full details of the pixel format by calling `SDL_GetPixelFormatDetails(surface->format)`. You can get the palette associated with the surface by calling SDL_GetSurfacePalette(). You can get the clip rectangle by calling SDL_GetSurfaceClipRect().

SDL_PixelFormat has been renamed SDL_PixelFormatDetails and just describes the pixel format, it does not include a palette for indexed pixel types.

SDL_PixelFormatEnum has been renamed SDL_PixelFormat and is used instead of Uint32 for API functions that refer to pixel format by enumerated value.

SDL_MapRGB(), SDL_MapRGBA(), SDL_GetRGB(), and SDL_GetRGBA() take an optional palette parameter for indexed color lookups.
2024-07-10 00:48:18 -07:00
Sam Lantinga
4fa5196820 Revert "Switch pixel format loss fields to number of bits"
This reverts commit 3c90b1c1f6.

It turns out this is problematic for sdl2-compat. We're investigating a more complete separation between SDL2 and SDL3 surfaces, but in the meantime, I'll fix the breakage.
2024-07-07 19:41:05 -07:00
SDL Wiki Bot
bfa4e71284 Sync SDL3 wiki -> header 2024-07-07 18:05:35 +00:00
SDL Wiki Bot
e37d6f71b3 Sync SDL3 wiki -> header 2024-07-07 18:02:15 +00:00
Sam Lantinga
3c90b1c1f6 Switch pixel format loss fields to number of bits
This makes more sense and handles pixel formats with > 8 bits per channel

Fixes https://github.com/libsdl-org/SDL/issues/10168
2024-07-06 11:37:16 -07:00
SDL Wiki Bot
f3ac2d9d4f Sync SDL3 wiki -> header 2024-07-06 15:46:41 +00:00
Frank Praznik
fbb5652d3e
video: Document that SDL_RaiseWindow is a request and subject to window manager policy
The result of SDL_RaiseWindow is ultimately subject to window manager policy, particularly if the request would result in stealing focus from another window. Document that this is only a request, and if successful, will result in a focus gained event along with the input focus flag being set on the window.
2024-07-06 11:45:43 -04:00
Sam Lantinga
0fa74d8aa8 Wiki-compatible documentation for SDL_ALPHA_OPAQUE and SDL_ALPHA_TRANSPARENT 2024-07-06 05:53:40 -07:00
SDL Wiki Bot
d5a0f60963 Sync SDL3 wiki -> header 2024-07-05 15:59:26 +00:00
Sam Lantinga
8412f52853 Clarified that the renderer should be destroyed before the window
I didn't add a note to SDL_DestroyWindow() because we actually protect against this case now, but it's useful information to know conceptually when working with the renderer.
2024-07-05 08:57:30 -07:00
SDL Wiki Bot
b43f1688d9 Sync SDL3 wiki -> header 2024-07-04 15:12:07 +00:00
Ryan C. Gordon
c3bf874abf stdlib: Clean up and export SDL_UCS4ToUTF8().
Also fix internal usage of the function.

Fixes #10157.
2024-07-04 11:10:50 -04:00
Ryan C. Gordon
f338fa20dd emscripten: Let SDL hints be set by URL parameters.
Any parameters (key/value pairs after the '?' in a URL) that have a keyname
that starts with `SDL_` will be put into Emscripten's environment variable
emulation table at startup, before SDL_main runs.

This lets users set hints the same way they might set them from a shell's
command line on a desktop platform:

For example:

`https://example.com/my_sdl3_application.html?SDL_RENDER_DRIVER=software`

Fixes #10154.
2024-07-04 11:09:42 -04:00
SDL Wiki Bot
d7a875432b Sync SDL3 wiki -> header 2024-07-03 20:07:11 +00:00
Ryan C. Gordon
2a8f1e11ca audio: Add gain support to audio streams and logical audio devices.
Fixes #10028.
2024-07-03 16:05:55 -04:00
Frank Praznik
74cc06db1b Remove the SDL_EVENT_WINDOW_TAKE_FOCUS event
This was added by the Unreal Engine to handle the input focus for popups and dialogs, window types for which SDL3 has built-in, cross-platform support.

This was only ever implemented in X11, and the only purpose was to hint that a client application may want to call the SDL_SetWindowInputFocus() function, which has since been removed, rendering it pointless now.
2024-07-03 15:08:21 -04:00
Frank Praznik
be13328cb1 Remove SDL_SetWindowInputFocus
This was added to SDL2 for the Unreal Engine's implementation of menus and dialogs on X11, window types for which SDL3 has added built-in, cross-platform support.

Remove this function, as it was only ever implemented for X11 and is now basically useless aside from allowing annoying or malicious client apps to discretely steal focus. As the documentation states: "You almost certainly want SDL_RaiseWindow() instead of this function."
2024-07-03 15:08:21 -04:00
SDL Wiki Bot
98f27b8f2e Sync SDL3 wiki -> header 2024-07-03 18:39:46 +00:00
Ryan C. Gordon
16e7fdc4f2 audio: Add channel remapping to SDL_AudioSpec and SDL_AudioStream.
Fixes #8367.
2024-07-03 14:38:33 -04:00