Commit graph

200 commits

Author SHA1 Message Date
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
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
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
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
ea11c9e0c7 Sync SDL3 wiki -> header 2024-06-24 19:23:37 +00:00
Sam Lantinga
0ff5c05486 Added SDL_GetWindows() 2024-06-24 12:22:12 -07:00
SDL Wiki Bot
83933fdfa0 Sync SDL3 wiki -> header 2024-06-20 19:55:37 +00:00
Frank Praznik
2f276a2eea video: Expose HDR metadata per-window
Moves the HDR properties from the display to be per-window, and adds the frog_color protocol to enable HDR under Wayland.
2024-06-20 15:55:07 -04:00
Anonymous Maarten
a64960cfc0 SDL_GLContext is not a void* pointer anymore 2024-06-15 14:44:09 +02:00
Anonymous Maarten
031dc0743f Use an opaque struct typedef for SDL_GLContext
Using a struct typedef instead of a void pointer results in extra C typechecks
2024-06-15 01:43:22 +02:00
Ryan C. Gordon
51902d4ac5
Updated headers with latest wikiheaders tweaks. 2024-06-14 02:09:55 -04:00
Ryan C. Gordon
2ad7c70ac6
documentation: clean up a minor syntax issue. 2024-06-13 18:10:28 -04:00
SDL Wiki Bot
49f2a3463f Sync SDL3 wiki -> header 2024-06-13 19:34:29 +00:00
Green Sky
997dd3e6eb reword SDL_FlashWindow params
so they link the types in the wiki
2024-06-08 17:25:27 -04:00
SDL Wiki Bot
9a4fc81bff Sync SDL3 wiki -> header 2024-06-06 17:59:48 +00:00
Sam Lantinga
5701c4f4bc Added migration documentation for iOS window properties
Fixes https://github.com/libsdl-org/SDL/issues/9430
2024-06-06 10:59:15 -07:00
SDL Wiki Bot
39c2dacc8f Sync SDL3 wiki -> header 2024-06-03 18:21:49 +00:00
Ryan C. Gordon
e23257307e Introduce formal policy for APIs that return strings.
This declares that any `const char *` returned from SDL is owned by SDL, and
promises to be valid _at least_ until the next time the event queue runs, or
SDL_Quit() is called, even if the thing that owns the string gets destroyed
or changed before then.

This is noted in the headers as "the SDL_GetStringRule", so this will both be
greppable to find a detailed explaination in docs/README-strings.md and
wikiheaders will automatically turn it into a link we can point at the
appropriate documentation.

Fixes #9902.

(and several FIXMEs, both known and yet-undocumented.)
2024-06-03 14:20:49 -04:00
SDL Wiki Bot
98fdef75bb Sync SDL3 wiki -> header 2024-05-28 18:54:02 +00:00
Sam Lantinga
c74886ab00 Added SDL_SetWindowAspectRatio() and SDL_GetWindowAspectRatio()
Fixes https://github.com/libsdl-org/SDL/issues/1573
2024-05-28 11:52:31 -07:00
Ryan C. Gordon
e508d82f74
include: Tweaked some vsync-related documentation.
Reference PR #9903.
2024-05-27 16:57:32 -04:00
SDL Wiki Bot
6524f9c9b8 Sync SDL3 wiki -> header 2024-05-27 20:12:47 +00:00
Sam Lantinga
dfe4445214 Added SDL_SetWindowSurfaceVSync() and SDL_GetWindowSurfaceVSync()
Fixes https://github.com/libsdl-org/SDL/issues/9347
2024-05-27 13:12:17 -07:00
SDL Wiki Bot
66fbbdf46a Sync SDL3 wiki -> header 2024-05-23 17:09:44 +00:00
SDL Wiki Bot
3e8d8f81b4 Sync SDL3 wiki -> header 2024-05-23 17:04:35 +00:00
Sam Lantinga
6f2621438a Renamed DECLSPEC to SDL_DECLSPEC 2024-05-17 17:09:09 -07:00
Ryan C. Gordon
5e6d85b8f0
wikiheaders: bridge wiki Category docs to the headers!
Did an initial cleanup on the headers and wrote a few pieces of documentation,
but this needs more work to fill out the documentation.
2024-05-16 11:48:23 -04: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
8bd0433966 Sync SDL3 wiki -> header 2024-05-13 07:19:15 +00:00
Ryan C. Gordon
9245084c06
SDL_video.h: Added a \sa from SDL_GLContext to SDL_GL_CreateContext. 2024-05-09 13:51:26 -04:00
Sam Lantinga
54fb629da5 SDL_WindowFlags is now 64-bit
Fixes https://github.com/libsdl-org/SDL/issues/7321
2024-05-09 10:39:54 -07:00
SDL Wiki Bot
7abc589438 Sync SDL3 wiki -> header 2024-05-08 16:56:38 +00:00
Frank Praznik
7d47d16526 kmsdrm: Report the panel orientation hint property
Queries the "panel orientation" property on the connector and reports it in degrees of clockwise rotation via the 'SDL.display.KMSDRM.panel_orientation' display property.

This is provided by the kernel as a hint to userspace applications, and the application itself is ultimately responsible for any required coordinate transformations needed to conform to the requested orientation.
2024-05-08 12:55:19 -04:00
Sam Lantinga
aecb62e30d Improved API consistency for flag data types
Flag data types are always unsigned and have the valid values following the typedef.
2024-05-07 12:24:37 -07:00
Ryan C. Gordon
a790a67883
include: Filling in more documentation gaps. 2024-05-03 13:19:26 -04:00
SDL Wiki Bot
97d0e78842 Sync SDL3 wiki -> header 2024-04-30 17:48:27 +00:00
Semphris
c6a70d6898 Add support for modal windows to more platforms
- Adds support for modal windows to Win32, Mac, and Haiku, and enhances functionality on Wayland and X11, which previous set only the parent window, but not the modal state.
- Windows can be declared modal at creation time, and the modal state can be toggled at any time via SDL_SetWindowModalFor() (tested with UE5 through sdl2-compat).
- Allows dynamic unparenting/reparenting of windows.
- Includes a modal window test.
2024-04-30 13:47:57 -04:00
SDL Wiki Bot
556d9b8497 Sync SDL3 wiki -> header 2024-04-30 10:45:12 +00:00
SDL Wiki Bot
57f96fb124 Sync SDL3 wiki -> header 2024-04-25 21:23:14 +00:00
SDL Wiki Bot
1b8d4d77d6 Sync SDL3 wiki -> header 2024-04-25 21:01:12 +00:00
SDL Wiki Bot
a13bdeee8a Sync SDL3 wiki -> header 2024-04-25 20:40:14 +00:00
Ryan C. Gordon
d29b861a76
wikiheaders: Allow blank lines in post-typedef #define blocks.
Reference Issue #9557.
2024-04-25 14:26:49 -04:00
Ryan C. Gordon
2fb024ab8e
wikiheaders: Defines directly following a non-struct typedef are documented.
The idea is that if you have a `typedef Uint32 MyFlags` that has a bunch of
defines that are meant to be bitflags, you can pack them into the same wiki
page automatically.

This only works with `typedef`s that are _not_ struct/union/enums, and it
only pulls in `#define` lines that immediately follow the typedef line.
Even a blank line or a comment will signal to stop including lines for
this page!
2024-04-25 03:02:27 -04:00
Frank Praznik
bede245395 Remove references to renderers being destroyed with windows in the documentation 2024-04-19 12:23:40 -04:00
Sam Lantinga
d69e6714a8 Document that tooltip windows don't get mouse or keyboard focus 2024-04-15 14:38:00 -07:00
SDL Wiki Bot
cdcd346575 Sync SDL3 wiki -> header 2024-04-15 19:13:11 +00:00
SDL Wiki Bot
1731d53d02 Sync SDL3 wiki -> header 2024-04-15 13:01:12 +00:00
Ryan C. Gordon
f01b34fd8d
include: Removed some SDL2 references in the documentation. 2024-04-13 09:23:37 -04:00
SDL Wiki Bot
cbb3c69cb0 Sync SDL3 wiki -> header 2024-04-13 01:10:12 +00:00