mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-17 02:08:27 +00:00
Added SDL_SetTextureUserData() and SDL_GetTextureUserData() to associate a user-specified pointer with an SDL texture
This commit is contained in:
parent
a0af7ce731
commit
f5794f9eeb
7 changed files with 46 additions and 2 deletions
|
@ -1486,6 +1486,23 @@ SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SetTextureUserData(SDL_Texture * texture, void *userdata)
|
||||
{
|
||||
CHECK_TEXTURE_MAGIC(texture, -1);
|
||||
|
||||
texture->userdata = userdata;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_GetTextureUserData(SDL_Texture * texture)
|
||||
{
|
||||
CHECK_TEXTURE_MAGIC(texture, NULL);
|
||||
|
||||
return texture->userdata;
|
||||
}
|
||||
|
||||
#if SDL_HAVE_YUV
|
||||
static int
|
||||
SDL_UpdateTextureYUV(SDL_Texture * texture, const SDL_Rect * rect,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue