mirror of
https://github.com/encounter/SDL.git
synced 2025-12-08 13:15:10 +00:00
Added SDL_SetTextureUserData() and SDL_GetTextureUserData() to associate a user-specified pointer with an SDL texture
This commit is contained in:
@@ -480,6 +480,28 @@ extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture,
|
||||
extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture,
|
||||
SDL_ScaleMode *scaleMode);
|
||||
|
||||
/**
|
||||
* Associate a user-specified pointer with a texture.
|
||||
*
|
||||
* \param texture the texture to update.
|
||||
* \param userdata the pointer to associate with the texture.
|
||||
* \returns 0 on success, or -1 if the texture is not valid.
|
||||
*
|
||||
* \sa SDL_GetTextureUserData
|
||||
*/
|
||||
extern DECLSPEC int SDLCALL SDL_SetTextureUserData(SDL_Texture * texture,
|
||||
void *userdata);
|
||||
|
||||
/**
|
||||
* Get the user-specified pointer associated with a texture
|
||||
*
|
||||
* \param texture the texture to query.
|
||||
* \return the pointer associated with the texture, or NULL if the texture is not valid.
|
||||
*
|
||||
* \sa SDL_SetTextureUserData
|
||||
*/
|
||||
extern DECLSPEC void * SDLCALL SDL_GetTextureUserData(SDL_Texture * texture);
|
||||
|
||||
/**
|
||||
* Update the given texture rectangle with new pixel data.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user