Update SDL2 to 2.0.8
This commit is contained in:
parent
8bd2c79109
commit
5bf60a9504
89 changed files with 2756 additions and 801 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2018 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
|
||||
|
@ -25,8 +25,8 @@
|
|||
* Header file for ::SDL_Surface definition and management functions.
|
||||
*/
|
||||
|
||||
#ifndef _SDL_surface_h
|
||||
#define _SDL_surface_h
|
||||
#ifndef SDL_surface_h_
|
||||
#define SDL_surface_h_
|
||||
|
||||
#include "SDL_stdinc.h"
|
||||
#include "SDL_pixels.h"
|
||||
|
@ -94,8 +94,19 @@ typedef struct SDL_Surface
|
|||
/**
|
||||
* \brief The type of function used for surface blitting functions.
|
||||
*/
|
||||
typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
|
||||
struct SDL_Surface * dst, SDL_Rect * dstrect);
|
||||
typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
|
||||
struct SDL_Surface * dst, SDL_Rect * dstrect);
|
||||
|
||||
/**
|
||||
* \brief The formula used for converting between YUV and RGB
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */
|
||||
SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */
|
||||
SDL_YUV_CONVERSION_BT709, /**< BT.709 */
|
||||
SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */
|
||||
} SDL_YUV_CONVERSION_MODE;
|
||||
|
||||
/**
|
||||
* Allocate and free an RGB surface.
|
||||
|
@ -118,6 +129,11 @@ typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
|
|||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface
|
||||
(Uint32 flags, int width, int height, int depth,
|
||||
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
||||
|
||||
/* !!! FIXME for 2.1: why does this ask for depth? Format provides that. */
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormat
|
||||
(Uint32 flags, int width, int height, int depth, Uint32 format);
|
||||
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
|
||||
int width,
|
||||
int height,
|
||||
|
@ -127,6 +143,8 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels,
|
|||
Uint32 Gmask,
|
||||
Uint32 Bmask,
|
||||
Uint32 Amask);
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceWithFormatFrom
|
||||
(void *pixels, int width, int height, int depth, int pitch, Uint32 format);
|
||||
extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface);
|
||||
|
||||
/**
|
||||
|
@ -184,6 +202,12 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
|
|||
/**
|
||||
* Save a surface to a seekable SDL data stream (memory or file).
|
||||
*
|
||||
* Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
|
||||
* BMP directly. Other RGB formats with 8-bit or higher get converted to a
|
||||
* 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
|
||||
* surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
|
||||
* not supported.
|
||||
*
|
||||
* If \c freedst is non-zero, the stream will be closed after being written.
|
||||
*
|
||||
* \return 0 if successful or -1 if there was an error.
|
||||
|
@ -346,6 +370,11 @@ extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface,
|
|||
extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface,
|
||||
SDL_Rect * rect);
|
||||
|
||||
/*
|
||||
* Creates a new surface identical to the existing surface
|
||||
*/
|
||||
extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface * surface);
|
||||
|
||||
/**
|
||||
* Creates a new surface of the specified format, and then copies and maps
|
||||
* the given surface to it so the blit of the converted surface will be as
|
||||
|
@ -491,6 +520,20 @@ extern DECLSPEC int SDLCALL SDL_LowerBlitScaled
|
|||
(SDL_Surface * src, SDL_Rect * srcrect,
|
||||
SDL_Surface * dst, SDL_Rect * dstrect);
|
||||
|
||||
/**
|
||||
* \brief Set the YUV conversion mode
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode);
|
||||
|
||||
/**
|
||||
* \brief Get the YUV conversion mode
|
||||
*/
|
||||
extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void);
|
||||
|
||||
/**
|
||||
* \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
|
||||
*/
|
||||
extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height);
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
@ -498,6 +541,6 @@ extern DECLSPEC int SDLCALL SDL_LowerBlitScaled
|
|||
#endif
|
||||
#include "close_code.h"
|
||||
|
||||
#endif /* _SDL_surface_h */
|
||||
#endif /* SDL_surface_h_ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue