SDL_GetTextureProperties(3)
๐ SDL_GetTextureProperties ๐
okay bestie, so this is a page from the SDL3 FUNCTIONS manual set, and it's about the lil function that spills the tea on a texture's properties. it's giving "tell me everything you know" energy and honestly? iconic.
โจ NAME โจ
SDL_GetTextureProperties โ get the properties associated with a texture. that's it, that's the vibe. ๐
๐ธ SYNOPSIS ๐ธ
#include <SDL3/SDL_render.h>
SDL_PropertiesID SDL_GetTextureProperties(SDL_Texture *texture);
๐ฆ DESCRIPTION ๐ฆ
so like, SDL itself is handing you these read-only properties, no take-backs, you just read them and move on. periodt.
SDL_PROP_TEXTURE_COLORSPACE_NUMBERโ anSDL_Colorspacevalue describing the texture colorspace. ๐จSDL_PROP_TEXTURE_FORMAT_NUMBERโ one of the enumerated values inSDL_PixelFormat.SDL_PROP_TEXTURE_ACCESS_NUMBERโ one of the enumerated values inSDL_TextureAccess.SDL_PROP_TEXTURE_WIDTH_NUMBERโ the width of the texture in pixels.SDL_PROP_TEXTURE_HEIGHT_NUMBERโ the height of the texture in pixels.SDL_PROP_TEXTURE_SDR_WHITE_POINT_FLOATโ for HDR10 and floating point textures, this defines the value of 100% diffuse white, with higher values being displayed in the High Dynamic Range headroom. this defaults to100for HDR10 textures and1.0for other textures. โญSDL_PROP_TEXTURE_HDR_HEADROOM_FLOATโ for HDR10 and floating point textures, this defines the maximum dynamic range used by the content, in terms of the SDR white point. if this is defined, any values outside the range supported by the display will be scaled into the available HDR headroom, otherwise they are clipped. this defaults to1.0for SDR textures,4.0for HDR10 textures, and no default for floating point textures. no cap, that last one really has no default. ๐
๐ฎ with the direct3d11 renderer:
SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTERโ theID3D11Texture2Dassociated with the textureSDL_PROP_TEXTURE_D3D11_TEXTURE_U_POINTERโ theID3D11Texture2Dassociated with the U plane of a YUV textureSDL_PROP_TEXTURE_D3D11_TEXTURE_V_POINTERโ theID3D11Texture2Dassociated with the V plane of a YUV texture
๐ฎ with the direct3d12 renderer:
SDL_PROP_TEXTURE_D3D12_TEXTURE_POINTERโ theID3D12Resourceassociated with the textureSDL_PROP_TEXTURE_D3D12_TEXTURE_U_POINTERโ theID3D12Resourceassociated with the U plane of a YUV textureSDL_PROP_TEXTURE_D3D12_TEXTURE_V_POINTERโ theID3D12Resourceassociated with the V plane of a YUV texture
๐ with the vulkan renderer:
SDL_PROP_TEXTURE_VULKAN_TEXTURE_NUMBERโ theVkImageassociated with the texture
๐ with the opengl renderer:
SDL_PROP_TEXTURE_OPENGL_TEXTURE_NUMBERโ theGLuinttexture associated with the textureSDL_PROP_TEXTURE_OPENGL_TEXTURE_UV_NUMBERโ theGLuinttexture associated with the UV plane of an NV12 textureSDL_PROP_TEXTURE_OPENGL_TEXTURE_U_NUMBERโ theGLuinttexture associated with the U plane of a YUV textureSDL_PROP_TEXTURE_OPENGL_TEXTURE_V_NUMBERโ theGLuinttexture associated with the V plane of a YUV textureSDL_PROP_TEXTURE_OPENGL_TEXTURE_TARGET_NUMBERโ theGLenumfor the texture target (GL_TEXTURE_2D,GL_TEXTURE_RECTANGLE_ARB, etc)SDL_PROP_TEXTURE_OPENGL_TEX_W_FLOATโ the texture coordinate width of the texture (0.0-1.0)SDL_PROP_TEXTURE_OPENGL_TEX_H_FLOATโ the texture coordinate height of the texture (0.0-1.0)
๐ธ with the opengles2 renderer:
SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_NUMBERโ theGLuinttexture associated with the textureSDL_PROP_TEXTURE_OPENGLES2_TEXTURE_UV_NUMBERโ theGLuinttexture associated with the UV plane of an NV12 textureSDL_PROP_TEXTURE_OPENGLES2_TEXTURE_U_NUMBERโ theGLuinttexture associated with the U plane of a YUV textureSDL_PROP_TEXTURE_OPENGLES2_TEXTURE_V_NUMBERโ theGLuinttexture associated with the V plane of a YUV textureSDL_PROP_TEXTURE_OPENGLES2_TEXTURE_TARGET_NUMBERโ theGLenumfor the texture target (GL_TEXTURE_2D,GL_TEXTURE_EXTERNAL_OES, etc)
๐ซถ with the gpu renderer:
SDL_PROP_TEXTURE_GPU_TEXTURE_POINTERโ theSDL_GPUTextureassociated with the textureSDL_PROP_TEXTURE_GPU_TEXTURE_UV_POINTERโ theSDL_GPUTextureassociated with the UV plane of an NV12 textureSDL_PROP_TEXTURE_GPU_TEXTURE_U_POINTERโ theSDL_GPUTextureassociated with the U plane of a YUV textureSDL_PROP_TEXTURE_GPU_TEXTURE_V_POINTERโ theSDL_GPUTextureassociated with the V plane of a YUV texture
๐ FUNCTION PARAMETERS ๐
textureโ the texture to query. like, the one you're asking about. ๐ซถ
๐ RETURN VALUE ๐
Returns a valid property ID on success or 0 on failure; call SDL_GetError() for more information. so if you get a 0, bestie, go read the error, it's literally right there. ๐ญ
๐ง THREAD SAFETY ๐ง
It is safe to call this function from any thread. yes queen, thread-safe, no notes. ๐ฅ
โญ AVAILABILITY โญ
This function is available since SDL 3.2.0. she's not ancient, she's fresh. ๐
and that's the whole page!! this one comes to you from Simple Directmedia Layer, running the SDL 3.4.18 era of the docs, and the page itself is dated SDL_GetTextureProperties(3). mwah, take care of your textures bestie ๐
โจ
๐ฆ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 ยท Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms