mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-15 17:28:28 +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
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue