Add SDL_GetWindowICCProfile(). (#4314)

* Add SDL_GetWindowICCProfile

* Add new SDL display events

* Implement ICC profile change event for macOS

* Implement ICC profile notification for Windows

* Fix SDL_GetWindowICCProfile() for X11

* Fix compile errors
This commit is contained in:
Cacodemon345
2021-10-22 06:37:20 +06:00
committed by GitHub
parent a34fe8161f
commit 19dee1cd16
18 changed files with 261 additions and 1 deletions

View File

@@ -174,7 +174,9 @@ typedef enum
SDL_WINDOWEVENT_FOCUS_LOST, /**< Window has lost keyboard focus */
SDL_WINDOWEVENT_CLOSE, /**< The window manager requests that the window be closed */
SDL_WINDOWEVENT_TAKE_FOCUS, /**< Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore) */
SDL_WINDOWEVENT_HIT_TEST /**< Window had a hit test that wasn't SDL_HITTEST_NORMAL. */
SDL_WINDOWEVENT_HIT_TEST, /**< Window had a hit test that wasn't SDL_HITTEST_NORMAL. */
SDL_WINDOWEVENT_ICCPROF_CHANGED,/**< The ICC profile of the window's display has changed. */
SDL_WINDOWEVENT_DISPLAY_CHANGED /**< Window has been moved to display data1. */
} SDL_WindowEventID;
/**
@@ -613,6 +615,17 @@ extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window,
extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window,
SDL_DisplayMode * mode);
/**
* Get the raw ICC profile data for the screen the window is currently on.
* Data returned should be freed with SDL_free.
*
* \param window the window to query
* \param size the size of the ICC profile
* \returns the raw ICC profile data on success or NULL on failure;
* call SDL_GetError() for more information.
*/
extern DECLSPEC void* SDLCALL SDL_GetWindowICCProfile(SDL_Window * window, size_t* size);
/**
* Get the pixel format associated with the window.
*