Made texture size and format public in the API

Also added refcount to textures so they can be retained by application code.
This commit is contained in:
Sam Lantinga 2024-09-30 20:40:54 -07:00
parent 5136b30652
commit 1f3a0d12e6
8 changed files with 76 additions and 66 deletions

View file

@ -118,11 +118,27 @@ typedef enum SDL_RendererLogicalPresentation
*/
typedef struct SDL_Renderer SDL_Renderer;
#ifndef SDL_INTERNAL
/**
* An efficient driver-specific representation of pixel data
*
* \since This struct is available since SDL 3.0.0.
*
* \sa SDL_CreateTexture
* \sa SDL_CreateTextureFromSurface
* \sa SDL_CreateTextureWithProperties
* \sa SDL_DestroyTexture
*/
struct SDL_Texture
{
SDL_PixelFormat format; /**< The format of the texture, read-only */
int w; /**< The width of the texture, read-only. */
int h; /**< The height of the texture, read-only. */
int refcount; /**< Application reference count, used when freeing texture */
};
#endif /* !SDL_INTERNAL */
typedef struct SDL_Texture SDL_Texture;
/* Function prototypes */