Updated SDL 2.0.16 headers and Mac version of libraries to fix GitHub actions
This commit is contained in:
parent
bc96500fe6
commit
294eeb3c1c
63 changed files with 1875 additions and 2694 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2021 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
|
@ -345,29 +345,16 @@ typedef struct SDL_PixelFormat
|
|||
} SDL_PixelFormat;
|
||||
|
||||
/**
|
||||
* Get the human readable name of a pixel format.
|
||||
*
|
||||
* \param format the pixel format to query
|
||||
* \returns the human readable name of the specified pixel format or
|
||||
* `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized.
|
||||
*
|
||||
* \since This function is available since SDL 2.0.0.
|
||||
* \brief Get the human readable name of a pixel format
|
||||
*/
|
||||
extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
|
||||
|
||||
/**
|
||||
* Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
|
||||
* \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
|
||||
*
|
||||
* \param format one of the SDL_PixelFormatEnum values
|
||||
* \param bpp a bits per pixel value; usually 15, 16, or 32
|
||||
* \param Rmask a pointer filled in with the red mask for the format
|
||||
* \param Gmask a pointer filled in with the green mask for the format
|
||||
* \param Bmask a pointer filled in with the blue mask for the format
|
||||
* \param Amask a pointer filled in with the alpha mask for the format
|
||||
* \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't
|
||||
* possible; call SDL_GetError() for more information.
|
||||
* \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
|
||||
*
|
||||
* \sa SDL_MasksToPixelFormatEnum
|
||||
* \sa SDL_MasksToPixelFormatEnum()
|
||||
*/
|
||||
extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
|
||||
int *bpp,
|
||||
|
@ -377,19 +364,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
|
|||
Uint32 * Amask);
|
||||
|
||||
/**
|
||||
* Convert a bpp value and RGBA masks to an enumerated pixel format.
|
||||
* \brief Convert a bpp and RGBA masks to an enumerated pixel format.
|
||||
*
|
||||
* This will return `SDL_PIXELFORMAT_UNKNOWN` if the conversion wasn't
|
||||
* possible.
|
||||
* \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
|
||||
* wasn't possible.
|
||||
*
|
||||
* \param bpp a bits per pixel value; usually 15, 16, or 32
|
||||
* \param Rmask the red mask for the format
|
||||
* \param Gmask the green mask for the format
|
||||
* \param Bmask the blue mask for the format
|
||||
* \param Amask the alpha mask for the format
|
||||
* \returns one of the SDL_PixelFormatEnum values
|
||||
*
|
||||
* \sa SDL_PixelFormatEnumToMasks
|
||||
* \sa SDL_PixelFormatEnumToMasks()
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
|
||||
Uint32 Rmask,
|
||||
|
@ -398,193 +378,84 @@ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
|
|||
Uint32 Amask);
|
||||
|
||||
/**
|
||||
* Create an SDL_PixelFormat structure corresponding to a pixel format.
|
||||
*
|
||||
* Returned structure may come from a shared global cache (i.e. not newly
|
||||
* allocated), and hence should not be modified, especially the palette. Weird
|
||||
* errors such as `Blit combination not supported` may occur.
|
||||
*
|
||||
* \param pixel_format one of the SDL_PixelFormatEnum values
|
||||
* \returns the new SDL_PixelFormat structure or NULL on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \sa SDL_FreeFormat
|
||||
* \brief Create an SDL_PixelFormat structure from a pixel format enum.
|
||||
*/
|
||||
extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
|
||||
|
||||
/**
|
||||
* Free an SDL_PixelFormat structure allocated by SDL_AllocFormat().
|
||||
*
|
||||
* \param format the SDL_PixelFormat structure to free
|
||||
*
|
||||
* \sa SDL_AllocFormat
|
||||
* \brief Free an SDL_PixelFormat structure.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format);
|
||||
|
||||
/**
|
||||
* Create a palette structure with the specified number of color entries.
|
||||
* \brief Create a palette structure with the specified number of color
|
||||
* entries.
|
||||
*
|
||||
* The palette entries are initialized to white.
|
||||
* \return A new palette, or NULL if there wasn't enough memory.
|
||||
*
|
||||
* \param ncolors represents the number of color entries in the color palette
|
||||
* \returns a new SDL_Palette structure on success or NULL on failure (e.g. if
|
||||
* there wasn't enough memory); call SDL_GetError() for more
|
||||
* information.
|
||||
* \note The palette entries are initialized to white.
|
||||
*
|
||||
* \sa SDL_FreePalette
|
||||
* \sa SDL_FreePalette()
|
||||
*/
|
||||
extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
|
||||
|
||||
/**
|
||||
* Set the palette for a pixel format structure.
|
||||
*
|
||||
* \param format the SDL_PixelFormat structure that will use the palette
|
||||
* \param palette the SDL_Palette structure that will be used
|
||||
* \returns 0 on success or a negative error code on failure; call
|
||||
* SDL_GetError() for more information.
|
||||
*
|
||||
* \sa SDL_AllocPalette
|
||||
* \sa SDL_FreePalette
|
||||
* \brief Set the palette for a pixel format structure.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
|
||||
SDL_Palette *palette);
|
||||
|
||||
/**
|
||||
* Set a range of colors in a palette.
|
||||
* \brief Set a range of colors in a palette.
|
||||
*
|
||||
* \param palette the SDL_Palette structure to modify
|
||||
* \param colors an array of SDL_Color structures to copy into the palette
|
||||
* \param firstcolor the index of the first palette entry to modify
|
||||
* \param ncolors the number of entries to modify
|
||||
* \returns 0 on success or a negative error code if not all of the colors
|
||||
* could be set; call SDL_GetError() for more information.
|
||||
* \param palette The palette to modify.
|
||||
* \param colors An array of colors to copy into the palette.
|
||||
* \param firstcolor The index of the first palette entry to modify.
|
||||
* \param ncolors The number of entries to modify.
|
||||
*
|
||||
* \sa SDL_AllocPalette
|
||||
* \sa SDL_CreateRGBSurface
|
||||
* \return 0 on success, or -1 if not all of the colors could be set.
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
|
||||
const SDL_Color * colors,
|
||||
int firstcolor, int ncolors);
|
||||
|
||||
/**
|
||||
* Free a palette created with SDL_AllocPalette().
|
||||
* \brief Free a palette created with SDL_AllocPalette().
|
||||
*
|
||||
* \param palette the SDL_Palette structure to be freed
|
||||
*
|
||||
* \sa SDL_AllocPalette
|
||||
* \sa SDL_AllocPalette()
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
|
||||
|
||||
/**
|
||||
* Map an RGB triple to an opaque pixel value for a given pixel format.
|
||||
* \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
|
||||
*
|
||||
* This function maps the RGB color value to the specified pixel format and
|
||||
* returns the pixel value best approximating the given RGB color value for
|
||||
* the given pixel format.
|
||||
*
|
||||
* If the format has a palette (8-bit) the index of the closest matching color
|
||||
* in the palette will be returned.
|
||||
*
|
||||
* If the specified pixel format has an alpha component it will be returned as
|
||||
* all 1 bits (fully opaque).
|
||||
*
|
||||
* If the pixel format bpp (color depth) is less than 32-bpp then the unused
|
||||
* upper bits of the return value can safely be ignored (e.g., with a 16-bpp
|
||||
* format the return value can be assigned to a Uint16, and similarly a Uint8
|
||||
* for an 8-bpp format).
|
||||
*
|
||||
* \param format an SDL_PixelFormat structure describing the pixel format
|
||||
* \param r the red component of the pixel in the range 0-255
|
||||
* \param g the green component of the pixel in the range 0-255
|
||||
* \param b the blue component of the pixel in the range 0-255
|
||||
* \returns a pixel value
|
||||
*
|
||||
* \sa SDL_GetRGB
|
||||
* \sa SDL_GetRGBA
|
||||
* \sa SDL_MapRGBA
|
||||
* \sa SDL_MapRGBA
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
|
||||
Uint8 r, Uint8 g, Uint8 b);
|
||||
|
||||
/**
|
||||
* Map an RGBA quadruple to a pixel value for a given pixel format.
|
||||
* \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
|
||||
*
|
||||
* This function maps the RGBA color value to the specified pixel format and
|
||||
* returns the pixel value best approximating the given RGBA color value for
|
||||
* the given pixel format.
|
||||
*
|
||||
* If the specified pixel format has no alpha component the alpha value will
|
||||
* be ignored (as it will be in formats with a palette).
|
||||
*
|
||||
* If the format has a palette (8-bit) the index of the closest matching color
|
||||
* in the palette will be returned.
|
||||
*
|
||||
* If the pixel format bpp (color depth) is less than 32-bpp then the unused
|
||||
* upper bits of the return value can safely be ignored (e.g., with a 16-bpp
|
||||
* format the return value can be assigned to a Uint16, and similarly a Uint8
|
||||
* for an 8-bpp format).
|
||||
*
|
||||
* \param format an SDL_PixelFormat structure describing the format of the
|
||||
* pixel
|
||||
* \param r the red component of the pixel in the range 0-255
|
||||
* \param g the green component of the pixel in the range 0-255
|
||||
* \param b the blue component of the pixel in the range 0-255
|
||||
* \param a the alpha component of the pixel in the range 0-255
|
||||
* \returns a pixel value
|
||||
*
|
||||
* \sa SDL_GetRGB
|
||||
* \sa SDL_GetRGBA
|
||||
* \sa SDL_MapRGB
|
||||
* \sa SDL_MapRGB
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
|
||||
Uint8 r, Uint8 g, Uint8 b,
|
||||
Uint8 a);
|
||||
|
||||
/**
|
||||
* Get RGB values from a pixel in the specified format.
|
||||
* \brief Get the RGB components from a pixel of the specified format.
|
||||
*
|
||||
* This function uses the entire 8-bit [0..255] range when converting color
|
||||
* components from pixel formats with less than 8-bits per RGB component
|
||||
* (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
|
||||
* 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
|
||||
*
|
||||
* \param pixel a pixel value
|
||||
* \param format an SDL_PixelFormat structure describing the format of the
|
||||
* pixel
|
||||
* \param r a pointer filled in with the red component
|
||||
* \param g a pointer filled in with the green component
|
||||
* \param b a pointer filled in with the blue component
|
||||
*
|
||||
* \sa SDL_GetRGBA
|
||||
* \sa SDL_MapRGB
|
||||
* \sa SDL_MapRGBA
|
||||
* \sa SDL_GetRGBA
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
|
||||
const SDL_PixelFormat * format,
|
||||
Uint8 * r, Uint8 * g, Uint8 * b);
|
||||
|
||||
/**
|
||||
* Get RGBA values from a pixel in the specified format.
|
||||
* \brief Get the RGBA components from a pixel of the specified format.
|
||||
*
|
||||
* This function uses the entire 8-bit [0..255] range when converting color
|
||||
* components from pixel formats with less than 8-bits per RGB component
|
||||
* (e.g., a completely white pixel in 16-bit RGB565 format would return [0xff,
|
||||
* 0xff, 0xff] not [0xf8, 0xfc, 0xf8]).
|
||||
*
|
||||
* If the surface has no alpha component, the alpha will be returned as 0xff
|
||||
* (100% opaque).
|
||||
*
|
||||
* \param pixel a pixel value
|
||||
* \param format an SDL_PixelFormat structure describing the format of the
|
||||
* pixel
|
||||
* \param r a pointer filled in with the red component
|
||||
* \param g a pointer filled in with the green component
|
||||
* \param b a pointer filled in with the blue component
|
||||
* \param a a pointer filled in with the alpha component
|
||||
*
|
||||
* \sa SDL_GetRGB
|
||||
* \sa SDL_MapRGB
|
||||
* \sa SDL_MapRGBA
|
||||
* \sa SDL_GetRGB
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
|
||||
const SDL_PixelFormat * format,
|
||||
|
@ -592,12 +463,7 @@ extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
|
|||
Uint8 * a);
|
||||
|
||||
/**
|
||||
* Calculate a 256 entry gamma ramp for a gamma value.
|
||||
*
|
||||
* \param gamma a gamma value where 0.0 is black and 1.0 is identity
|
||||
* \param ramp an array of 256 values filled in with the gamma ramp
|
||||
*
|
||||
* \sa SDL_SetWindowGammaRamp
|
||||
* \brief Calculate a 256 entry gamma ramp for a gamma value.
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue