mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-06 15:30:50 +00:00
Added HDR display properties and related event
Also added an HDR calibration stage to testcolorspace
This commit is contained in:
parent
d4caef5b89
commit
30e176d6ba
11 changed files with 510 additions and 57 deletions
|
@ -97,8 +97,9 @@ typedef enum
|
|||
SDL_EVENT_DISPLAY_REMOVED, /**< Display has been removed from the system */
|
||||
SDL_EVENT_DISPLAY_MOVED, /**< Display has changed position */
|
||||
SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED, /**< Display has changed content scale */
|
||||
SDL_EVENT_DISPLAY_HDR_STATE_CHANGED, /**< Display HDR properties have changed */
|
||||
SDL_EVENT_DISPLAY_FIRST = SDL_EVENT_DISPLAY_ORIENTATION,
|
||||
SDL_EVENT_DISPLAY_LAST = SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED,
|
||||
SDL_EVENT_DISPLAY_LAST = SDL_EVENT_DISPLAY_HDR_STATE_CHANGED,
|
||||
|
||||
/* Window events */
|
||||
/* 0x200 was SDL_WINDOWEVENT, reserve the number for sdl2-compat */
|
||||
|
|
|
@ -234,12 +234,12 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window *window, co
|
|||
*
|
||||
* These are the supported properties:
|
||||
*
|
||||
* - `SDL_PROP_RENDERER_CREATE_WINDOW_POINTER`: the window where rendering is
|
||||
* displayed
|
||||
* - `SDL_PROP_RENDERER_CREATE_SURFACE_POINTER`: the surface where rendering
|
||||
* is displayed, if you want a software renderer without a window
|
||||
* - `SDL_PROP_RENDERER_CREATE_NAME_STRING`: the name of the rendering driver
|
||||
* to use, if a specific one is desired
|
||||
* - `SDL_PROP_RENDERER_CREATE_WINDOW_POINTER`: the window where rendering is
|
||||
* displayed, required if this isn't a software renderer using a surface
|
||||
* - `SDL_PROP_RENDERER_CREATE_SURFACE_POINTER`: the surface where rendering
|
||||
* is displayed, if you want a software renderer without a window
|
||||
* - `SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER`: an SDL_ColorSpace
|
||||
* value describing the colorspace for output to the display, defaults to
|
||||
* SDL_COLORSPACE_SRGB. The direct3d11 and direct3d12 renderers support
|
||||
|
@ -263,9 +263,9 @@ extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window *window, co
|
|||
*/
|
||||
extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRendererWithProperties(SDL_PropertiesID props);
|
||||
|
||||
#define SDL_PROP_RENDERER_CREATE_NAME_STRING "name"
|
||||
#define SDL_PROP_RENDERER_CREATE_WINDOW_POINTER "window"
|
||||
#define SDL_PROP_RENDERER_CREATE_SURFACE_POINTER "surface"
|
||||
#define SDL_PROP_RENDERER_CREATE_NAME_STRING "name"
|
||||
#define SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER "output_colorspace"
|
||||
#define SDL_PROP_RENDERER_CREATE_PRESENT_VSYNC_BOOLEAN "present_vsync"
|
||||
|
||||
|
@ -334,6 +334,10 @@ extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_Rend
|
|||
*
|
||||
* The following read-only properties are provided by SDL:
|
||||
*
|
||||
* - `SDL_PROP_RENDERER_NAME_STRING`: the name of the rendering driver
|
||||
* - `SDL_PROP_RENDERER_WINDOW_POINTER`: the window where rendering is displayed, if any
|
||||
* - `SDL_PROP_RENDERER_SURFACE_POINTER`: the surface where rendering is displayed, if this is a software renderer without a window
|
||||
* - `SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER`: an SDL_ColorSpace value describing the colorspace for output to the display, defaults to SDL_COLORSPACE_SRGB.
|
||||
* - `SDL_PROP_RENDERER_D3D9_DEVICE_POINTER`: the IDirect3DDevice9 associated
|
||||
* with the renderer
|
||||
* - `SDL_PROP_RENDERER_D3D11_DEVICE_POINTER`: the ID3D11Device associated
|
||||
|
@ -354,6 +358,10 @@ extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_Rend
|
|||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Renderer *renderer);
|
||||
|
||||
#define SDL_PROP_RENDERER_NAME_STRING "SDL.renderer.name"
|
||||
#define SDL_PROP_RENDERER_WINDOW_POINTER "SDL.renderer.window"
|
||||
#define SDL_PROP_RENDERER_SURFACE_POINTER "SDL.renderer.surface"
|
||||
#define SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER "SDL.renderer.output_colorspace"
|
||||
#define SDL_PROP_RENDERER_D3D9_DEVICE_POINTER "SDL.renderer.d3d9.device"
|
||||
#define SDL_PROP_RENDERER_D3D11_DEVICE_POINTER "SDL.renderer.d3d11.device"
|
||||
#define SDL_PROP_RENDERER_D3D12_DEVICE_POINTER "SDL.renderer.d3d12.device"
|
||||
|
|
|
@ -353,6 +353,11 @@ extern DECLSPEC SDL_DisplayID SDLCALL SDL_GetPrimaryDisplay(void);
|
|||
/**
|
||||
* Get the properties associated with a display.
|
||||
*
|
||||
* The following read-only properties are provided by SDL:
|
||||
*
|
||||
* - `SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN`: true if the display has High Dynamic Range enabled
|
||||
* - `SDL_PROP_DISPLAY_SDR_WHITE_LEVEL_FLOAT`: the luminance, in nits, that SDR white is rendered on this display. If this value is not set or is zero, the value 200 is a reasonable default when HDR is enabled.
|
||||
*
|
||||
* \param displayID the instance ID of the display to query
|
||||
* \returns a valid property ID on success or 0 on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
|
@ -364,6 +369,9 @@ extern DECLSPEC SDL_DisplayID SDLCALL SDL_GetPrimaryDisplay(void);
|
|||
*/
|
||||
extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetDisplayProperties(SDL_DisplayID displayID);
|
||||
|
||||
#define SDL_PROP_DISPLAY_HDR_ENABLED_BOOLEAN "SDL.display.HDR_enabled"
|
||||
#define SDL_PROP_DISPLAY_SDR_WHITE_LEVEL_FLOAT "SDL.display.SDR_white_level"
|
||||
|
||||
/**
|
||||
* Get the name of a display in UTF-8 encoding.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue