Sync wiki -> headers.

This commit is contained in:
Ryan C. Gordon 2023-11-09 20:11:23 -05:00
parent 74f3643bfa
commit aa7baf63aa
No known key found for this signature in database
GPG key ID: FA148B892AB48044
5 changed files with 72 additions and 53 deletions

View file

@ -124,7 +124,8 @@ extern DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props);
extern DECLSPEC int SDLCALL SDL_SetProperty(SDL_PropertiesID props, const char *name, void *value); extern DECLSPEC int SDLCALL SDL_SetProperty(SDL_PropertiesID props, const char *name, void *value);
/** /**
* Set a property on a set of properties with a cleanup function that is called when the property is deleted * Set a property on a set of properties with a cleanup function that is
* called when the property is deleted
* *
* \param props the properties to modify * \param props the properties to modify
* \param name the name of the property to modify * \param name the name of the property to modify
@ -147,7 +148,10 @@ extern DECLSPEC int SDLCALL SDL_SetPropertyWithCleanup(SDL_PropertiesID props, c
/** /**
* Get a property on a set of properties * Get a property on a set of properties
* *
* By convention, the names of properties that SDL exposes on objects will start with "SDL.", and properties that SDL uses internally will start with "SDL.internal.". These should be considered read-only and should not be modified by applications. * By convention, the names of properties that SDL exposes on objects will
* start with "SDL.", and properties that SDL uses internally will start with
* "SDL.internal.". These should be considered read-only and should not be
* modified by applications.
* *
* \param props the properties to query * \param props the properties to query
* \param name the name of the property to query * \param name the name of the property to query

View file

@ -309,11 +309,12 @@ extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_Rend
/** /**
* Get the properties associated with a renderer. * Get the properties associated with a renderer.
* *
* The following properties are provided by SDL: * The following properties are provided by SDL: "SDL.renderer.d3d9.device" -
* "SDL.renderer.d3d9.device" - the IDirect3DDevice9 associated with the renderer * the IDirect3DDevice9 associated with the renderer
* "SDL.renderer.d3d11.device" - the ID3D11Device associated with the renderer * "SDL.renderer.d3d11.device" - the ID3D11Device associated with the renderer
* "SDL.renderer.d3d12.device" - the ID3D12Device associated with the renderer * "SDL.renderer.d3d12.device" - the ID3D12Device associated with the renderer
* "SDL.renderer.d3d12.command_queue" - the ID3D12CommandQueue associated with the renderer * "SDL.renderer.d3d12.command_queue" - the ID3D12CommandQueue associated with
* the renderer
* *
* \param renderer the rendering context * \param renderer the rendering context
* \returns a valid property ID on success or 0 on failure; call * \returns a valid property ID on success or 0 on failure; call

View file

@ -47,10 +47,13 @@ extern "C" {
typedef struct tagMSG MSG; typedef struct tagMSG MSG;
typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg); typedef SDL_bool (SDLCALL *SDL_WindowsMessageHook)(void *userdata, MSG *msg);
/** /**
* Set a callback for every Windows message, run before TranslateMessage(). * Set a callback for every Windows message, run before TranslateMessage().
* *
* The callback may modify the message, and should return SDL_TRUE if the message should continue to be processed, or SDL_FALSE to prevent further processing. * The callback may modify the message, and should return SDL_TRUE if the
* message should continue to be processed, or SDL_FALSE to prevent further
* processing.
* *
* \param callback The SDL_WindowsMessageHook function to call. * \param callback The SDL_WindowsMessageHook function to call.
* \param userdata a pointer to pass to every iteration of `callback` * \param userdata a pointer to pass to every iteration of `callback`
@ -106,10 +109,13 @@ extern DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo(SDL_DisplayID displayID,
typedef union _XEvent XEvent; typedef union _XEvent XEvent;
typedef SDL_bool (SDLCALL *SDL_X11EventHook)(void *userdata, XEvent *xevent); typedef SDL_bool (SDLCALL *SDL_X11EventHook)(void *userdata, XEvent *xevent);
/** /**
* Set a callback for every X11 event * Set a callback for every X11 event
* *
* The callback may modify the event, and should return SDL_TRUE if the event should continue to be processed, or SDL_FALSE to prevent further processing. * The callback may modify the event, and should return SDL_TRUE if the event
* should continue to be processed, or SDL_FALSE to prevent further
* processing.
* *
* \param callback The SDL_X11EventHook function to call. * \param callback The SDL_X11EventHook function to call.
* \param userdata a pointer to pass to every iteration of `callback` * \param userdata a pointer to pass to every iteration of `callback`

View file

@ -936,53 +936,53 @@ extern DECLSPEC SDL_Window *SDLCALL SDL_GetWindowParent(SDL_Window *window);
* *
* The following properties are provided by SDL: * The following properties are provided by SDL:
* *
* On Android: * On Android: "SDL.window.android.window" - the ANativeWindow associated with
* "SDL.window.android.window" - the ANativeWindow associated with the window * the window "SDL.window.android.surface" - the EGLSurface associated with
* "SDL.window.android.surface" - the EGLSurface associated with the window * the window
* *
* On iOS: * On iOS: "SDL.window.uikit.window" - the (__unsafe_unretained) UIWindow
* "SDL.window.uikit.window" - the (__unsafe_unretained) UIWindow associated with the window * associated with the window "SDL.window.uikit.metal_view_tag" - the
* "SDL.window.uikit.metal_view_tag" - the NSInteger tag assocated with metal views on the window * NSInteger tag assocated with metal views on the window
* *
* On KMS/DRM: * On KMS/DRM: "SDL.window.kmsdrm.dev_index" - the device index associated
* "SDL.window.kmsdrm.dev_index" - the device index associated with the window (e.g. the X in /dev/dri/cardX) * with the window (e.g. the X in /dev/dri/cardX) "SDL.window.kmsdrm.drm_fd" -
* "SDL.window.kmsdrm.drm_fd" - the DRM FD associated with the window * the DRM FD associated with the window "SDL.window.kmsdrm.gbm_dev" - the GBM
* "SDL.window.kmsdrm.gbm_dev" - the GBM device associated with the window * device associated with the window
* *
* On macOS: * On macOS: "SDL.window.cocoa.window" - the (__unsafe_unretained) NSWindow
* "SDL.window.cocoa.window" - the (__unsafe_unretained) NSWindow associated with the window * associated with the window "SDL.window.cocoa.metal_view_tag" - the
* "SDL.window.cocoa.metal_view_tag" - the NSInteger tag assocated with metal views on the window * NSInteger tag assocated with metal views on the window
* *
* On Vivante: * On Vivante: "SDL.window.vivante.display" - the EGLNativeDisplayType
* "SDL.window.vivante.display" - the EGLNativeDisplayType associated with the window * associated with the window "SDL.window.vivante.window" - the
* "SDL.window.vivante.window" - the EGLNativeWindowType associated with the window * EGLNativeWindowType associated with the window "SDL.window.vivante.surface"
* "SDL.window.vivante.surface" - the EGLSurface associated with the window * - the EGLSurface associated with the window
* *
* On UWP: * On UWP: "SDL.window.winrt.window" - the IInspectable CoreWindow associated
* "SDL.window.winrt.window" - the IInspectable CoreWindow associated with the window * with the window
* *
* On Windows: * On Windows: "SDL.window.win32.hwnd" - the HWND associated with the window
* "SDL.window.win32.hwnd" - the HWND associated with the window
* "SDL.window.win32.hdc" - the HDC associated with the window * "SDL.window.win32.hdc" - the HDC associated with the window
* "SDL.window.win32.instance" - the HINSTANCE associated with the window * "SDL.window.win32.instance" - the HINSTANCE associated with the window
* *
* On Wayland: * On Wayland: "SDL.window.wayland.registry" - the wl_registry associated with
* "SDL.window.wayland.registry" - the wl_registry associated with the window * the window "SDL.window.wayland.display" - the wl_display associated with
* "SDL.window.wayland.display" - the wl_display associated with the window * the window "SDL.window.wayland.surface" - the wl_surface associated with
* "SDL.window.wayland.surface" - the wl_surface associated with the window * the window "SDL.window.wayland.egl_window" - the wl_egl_window associated
* "SDL.window.wayland.egl_window" - the wl_egl_window associated with the window * with the window "SDL.window.wayland.xdg_surface" - the xdg_surface
* "SDL.window.wayland.xdg_surface" - the xdg_surface associated with the window * associated with the window "SDL.window.wayland.xdg_toplevel" - the
* "SDL.window.wayland.xdg_toplevel" - the xdg_toplevel role associated with the window * xdg_toplevel role associated with the window "SDL.window.wayland.xdg_popup"
* "SDL.window.wayland.xdg_popup" - the xdg_popup role associated with the window * - the xdg_popup role associated with the window
* "SDL.window.wayland.xdg_positioner" - the xdg_positioner associated with the window, in popup mode * "SDL.window.wayland.xdg_positioner" - the xdg_positioner associated with
* the window, in popup mode
* *
* Note: The xdg_* window objects do not internally persist across window show/hide calls. * Note: The xdg_* window objects do not internally persist across window
* They will be null if the window is hidden and must be queried each time it is shown. * show/hide calls. They will be null if the window is hidden and must be
* queried each time it is shown.
* *
* On X11: * On X11: "SDL.window.x11.display" - the X11 Display associated with the
* "SDL.window.x11.display" - the X11 Display associated with the window * window "SDL.window.x11.screen" - the screen number associated with the
* "SDL.window.x11.screen" - the screen number associated with the window * window "SDL.window.x11.window" - the X11 Window associated with the window
* "SDL.window.x11.window" - the X11 Window associated with the window
* *
* \param window the window to query * \param window the window to query
* \returns a valid property ID on success or 0 on failure; call * \returns a valid property ID on success or 0 on failure; call

View file

@ -126,8 +126,8 @@ extern DECLSPEC SDL_VideoCaptureDeviceID *SDLCALL SDL_GetVideoCaptureDevices(int
* Open a Video Capture device * Open a Video Capture device
* *
* \param instance_id the video capture device instance ID * \param instance_id the video capture device instance ID
* \returns device, or NULL on failure; call * \returns device, or NULL on failure; call SDL_GetError() for more
* SDL_GetError() for more information. * information.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
@ -165,8 +165,8 @@ extern DECLSPEC int SDLCALL SDL_SetVideoCaptureSpec(SDL_VideoCaptureDevice *devi
* \param desired desired video capture spec * \param desired desired video capture spec
* \param obtained obtained video capture spec * \param obtained obtained video capture spec
* \param allowed_changes allow changes or not * \param allowed_changes allow changes or not
* \returns device, or NULL on failure; call * \returns device, or NULL on failure; call SDL_GetError() for more
* SDL_GetError() for more information. * information.
* *
* \since This function is available since SDL 3.0.0. * \since This function is available since SDL 3.0.0.
* *
@ -178,6 +178,7 @@ extern DECLSPEC SDL_VideoCaptureDevice *SDLCALL SDL_OpenVideoCaptureWithSpec(SDL
const SDL_VideoCaptureSpec *desired, const SDL_VideoCaptureSpec *desired,
SDL_VideoCaptureSpec *obtained, SDL_VideoCaptureSpec *obtained,
int allowed_changes); int allowed_changes);
/** /**
* Get device name * Get device name
* *
@ -208,6 +209,7 @@ extern DECLSPEC int SDLCALL SDL_GetVideoCaptureSpec(SDL_VideoCaptureDevice *devi
/** /**
* Get frame format of video capture device. * Get frame format of video capture device.
*
* The value can be used to fill SDL_VideoCaptureSpec structure. * The value can be used to fill SDL_VideoCaptureSpec structure.
* *
* \param device opened video capture device * \param device opened video capture device
@ -240,6 +242,7 @@ extern DECLSPEC int SDLCALL SDL_GetNumVideoCaptureFormats(SDL_VideoCaptureDevice
/** /**
* Get frame sizes of the device and the specified input format. * Get frame sizes of the device and the specified input format.
*
* The value can be used to fill SDL_VideoCaptureSpec structure. * The value can be used to fill SDL_VideoCaptureSpec structure.
* *
* \param device opened video capture device * \param device opened video capture device
@ -300,11 +303,13 @@ extern DECLSPEC int SDLCALL SDL_StartVideoCapture(SDL_VideoCaptureDevice *device
/** /**
* Acquire a frame. * Acquire a frame.
* The frame is a memory pointer to the image data, whose size and format
* are given by the the obtained spec.
* *
* Non blocking API. If there is a frame available, frame->num_planes is non 0. * The frame is a memory pointer to the image data, whose size and format are
* If frame->num_planes is 0 and returned code is 0, there is no frame at that time. * given by the the obtained spec.
*
* Non blocking API. If there is a frame available, frame->num_planes is non
* 0. If frame->num_planes is 0 and returned code is 0, there is no frame at
* that time.
* *
* After used, the frame should be released with SDL_ReleaseVideoCaptureFrame * After used, the frame should be released with SDL_ReleaseVideoCaptureFrame
* *
@ -320,7 +325,9 @@ extern DECLSPEC int SDLCALL SDL_StartVideoCapture(SDL_VideoCaptureDevice *device
extern DECLSPEC int SDLCALL SDL_AcquireVideoCaptureFrame(SDL_VideoCaptureDevice *device, SDL_VideoCaptureFrame *frame); extern DECLSPEC int SDLCALL SDL_AcquireVideoCaptureFrame(SDL_VideoCaptureDevice *device, SDL_VideoCaptureFrame *frame);
/** /**
* Release a frame. Let the back-end re-use the internal buffer for video capture. * Release a frame.
*
* Let the back-end re-use the internal buffer for video capture.
* *
* All acquired frames should be released before closing the device. * All acquired frames should be released before closing the device.
* *
@ -349,7 +356,8 @@ extern DECLSPEC int SDLCALL SDL_ReleaseVideoCaptureFrame(SDL_VideoCaptureDevice
extern DECLSPEC int SDLCALL SDL_StopVideoCapture(SDL_VideoCaptureDevice *device); extern DECLSPEC int SDLCALL SDL_StopVideoCapture(SDL_VideoCaptureDevice *device);
/** /**
* Use this function to shut down video_capture processing and close the video_capture device. * Use this function to shut down video_capture processing and close the
* video_capture device.
* *
* \param device opened video capture device * \param device opened video capture device
* *