Added SDL_SetRenderDrawColorspace() and SDL_GetRenderDrawColorspace()

This commit is contained in:
Sam Lantinga 2024-01-31 21:46:02 -08:00
parent 9c8b47b726
commit dd28ab0489
5 changed files with 64 additions and 1 deletions

View file

@ -1361,7 +1361,40 @@ extern DECLSPEC int SDLCALL SDL_SetRenderScale(SDL_Renderer *renderer, float sca
extern DECLSPEC int SDLCALL SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY);
/**
* Set the color used for drawing operations (Rect, Line and Clear).
* Set the colorspace used for drawing operations
*
* The default colorspace for drawing operations is SDL_COLORSPACE_SRGB, but you can change it to other colorspaces such as SDL_COLORSPACE_SCRGB for HDR rendering.
*
* This does not affect the colorspace of textures, which is specified via properties when the texture is created and does not change.
*
* \param renderer the rendering context
* \param colorspace an SDL_ColorSpace value describing the colorspace for drawing operations
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_GetRenderDrawColorspace
*/
extern DECLSPEC int SDLCALL SDL_SetRenderDrawColorspace(SDL_Renderer *renderer, SDL_Colorspace colorspace);
/**
* Get the colorspace used for drawing operations
*
* \param renderer the rendering context
* \param colorspace a pointer filled in with an SDL_ColorSpace value describing the colorspace for drawing operations
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_SetRenderDrawColorspace
*/
extern DECLSPEC int SDLCALL SDL_GetRenderDrawColorspace(SDL_Renderer *renderer, SDL_Colorspace *colorspace);
/**
* Set the color used for drawing operations.
*
* Set the color for drawing or filling rectangles, lines, and points, and for
* SDL_RenderClear().