SDL_QueryTexture() fills in a pointer to SDL_PixelFormatEnum

This commit is contained in:
Sam Lantinga 2024-04-01 15:35:46 -07:00
parent aea44cff6b
commit a82ed82bc7
5 changed files with 12 additions and 12 deletions

View File

@ -814,7 +814,7 @@ extern DECLSPEC SDL_Renderer *SDLCALL SDL_GetRendererFromTexture(SDL_Texture *te
*
* \since This function is available since SDL 3.0.0.
*/
extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture *texture, Uint32 *format, int *access, int *w, int *h);
extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture *texture, SDL_PixelFormatEnum *format, int *access, int *w, int *h);
/**
* Set an additional color value multiplied into render copy operations.

View File

@ -654,7 +654,7 @@ SDL_DYNAPI_PROC(int,SDL_PremultiplyAlpha,(int a, int b, SDL_PixelFormatEnum c, c
SDL_DYNAPI_PROC(void,SDL_PumpEvents,(void),(),)
SDL_DYNAPI_PROC(int,SDL_PushEvent,(SDL_Event *a),(a),return)
SDL_DYNAPI_PROC(int,SDL_PutAudioStreamData,(SDL_AudioStream *a, const void *b, int c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_QueryTexture,(SDL_Texture *a, Uint32 *b, int *c, int *d, int *e),(a,b,c,d,e),return)
SDL_DYNAPI_PROC(int,SDL_QueryTexture,(SDL_Texture *a, SDL_PixelFormatEnum *b, int *c, int *d, int *e),(a,b,c,d,e),return)
SDL_DYNAPI_PROC(void,SDL_Quit,(void),(),)
SDL_DYNAPI_PROC(void,SDL_QuitSubSystem,(Uint32 a),(a),)
SDL_DYNAPI_PROC(int,SDL_RaiseWindow,(SDL_Window *a),(a),return)

View File

@ -1603,7 +1603,7 @@ SDL_PropertiesID SDL_GetTextureProperties(SDL_Texture *texture)
return texture->props;
}
int SDL_QueryTexture(SDL_Texture *texture, Uint32 *format, int *access, int *w, int *h)
int SDL_QueryTexture(SDL_Texture *texture, SDL_PixelFormatEnum *format, int *access, int *w, int *h)
{
CHECK_TEXTURE_MAGIC(texture, -1);

View File

@ -388,7 +388,7 @@ static int render_testBlit(void *arg)
SDL_FRect rect;
SDL_Texture *tface;
SDL_Surface *referenceSurface = NULL;
Uint32 tformat;
SDL_PixelFormatEnum tformat;
int taccess, tw, th;
int i, j, ni, nj;
int checkFailCount1;
@ -456,7 +456,7 @@ static int render_testBlitColor(void *arg)
SDL_FRect rect;
SDL_Texture *tface;
SDL_Surface *referenceSurface = NULL;
Uint32 tformat;
SDL_PixelFormatEnum tformat;
int taccess, tw, th;
int i, j, ni, nj;
int checkFailCount1;
@ -530,7 +530,7 @@ static int render_testBlitAlpha(void *arg)
SDL_FRect rect;
SDL_Texture *tface;
SDL_Surface *referenceSurface = NULL;
Uint32 tformat;
SDL_PixelFormatEnum tformat;
int taccess, tw, th;
int i, j, ni, nj;
int checkFailCount1;
@ -604,7 +604,7 @@ static void
testBlitBlendMode(SDL_Texture *tface, int mode)
{
int ret;
Uint32 tformat;
SDL_PixelFormatEnum tformat;
int taccess, tw, th;
int i, j, ni, nj;
SDL_FRect rect;
@ -659,7 +659,7 @@ static int render_testBlitBlend(void *arg)
SDL_FRect rect;
SDL_Texture *tface;
SDL_Surface *referenceSurface = NULL;
Uint32 tformat;
SDL_PixelFormatEnum tformat;
int taccess, tw, th;
int i, j, ni, nj;
int mode;

View File

@ -285,7 +285,7 @@ static void MoveSprite(void)
}
}
static Uint32 GetTextureFormat(enum AVPixelFormat format)
static SDL_PixelFormatEnum GetTextureFormat(enum AVPixelFormat format)
{
switch (format) {
case AV_PIX_FMT_RGB8:
@ -509,7 +509,7 @@ static SDL_Colorspace GetFrameColorspace(AVFrame *frame)
return colorspace;
}
static SDL_PropertiesID CreateVideoTextureProperties(AVFrame *frame, Uint32 format, int access)
static SDL_PropertiesID CreateVideoTextureProperties(AVFrame *frame, SDL_PixelFormatEnum format, int access)
{
AVFrameSideData *pSideData;
SDL_PropertiesID props;
@ -569,8 +569,8 @@ static void SDLCALL FreeSwsContextContainer(void *userdata, void *value)
static SDL_bool GetTextureForMemoryFrame(AVFrame *frame, SDL_Texture **texture)
{
int texture_width = 0, texture_height = 0;
Uint32 texture_format = SDL_PIXELFORMAT_UNKNOWN;
Uint32 frame_format = GetTextureFormat(frame->format);
SDL_PixelFormatEnum texture_format = SDL_PIXELFORMAT_UNKNOWN;
SDL_PixelFormatEnum frame_format = GetTextureFormat(frame->format);
if (*texture) {
SDL_QueryTexture(*texture, &texture_format, NULL, &texture_width, &texture_height);