---
name: "SDL_GetTextureProperties"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_GetTextureProperties"
---

# SDL\_GetTextureProperties(3)

Get the properties associated with a texture.

## NAME

SDL\_GetTextureProperties - Get the properties associated with a texture.

## HEADER FILE

Defined in SDL3/SDL\_render.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**SDL\_PropertiesID SDL\_GetTextureProperties(SDL\_Texture \*texture);**

## DESCRIPTION

The following read-only properties are provided by SDL:

•  **SDL\_PROP\_TEXTURE\_COLORSPACE\_NUMBER** :\
   an  **SDL\_Colorspace**\
  value describing the texture\
   colorspace.

•  **SDL\_PROP\_TEXTURE\_FORMAT\_NUMBER** : one\
   of the enumerated values in  **SDL\_PixelFormat** .

•  **SDL\_PROP\_TEXTURE\_ACCESS\_NUMBER** : one\
   of the enumerated values in  **SDL\_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 to 100 for HDR10 textures and 1.0 for 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 to 1.0 for SDR textures, 4.0 for HDR10 textures, and no default\
   for floating point textures.

With the direct3d11 renderer:

•  **SDL\_PROP\_TEXTURE\_D3D11\_TEXTURE\_POINTER** :\
   the ID3D11Texture2D associated with the texture

•  **SDL\_PROP\_TEXTURE\_D3D11\_TEXTURE\_U\_POINTER** :\
   the ID3D11Texture2D associated with the U plane of a YUV texture

•  **SDL\_PROP\_TEXTURE\_D3D11\_TEXTURE\_V\_POINTER** :\
   the ID3D11Texture2D associated with the V plane of a YUV texture

With the direct3d12 renderer:

•  **SDL\_PROP\_TEXTURE\_D3D12\_TEXTURE\_POINTER** :\
   the ID3D12Resource associated with the texture

•  **SDL\_PROP\_TEXTURE\_D3D12\_TEXTURE\_U\_POINTER** :\
   the ID3D12Resource associated with the U plane of a YUV texture

•  **SDL\_PROP\_TEXTURE\_D3D12\_TEXTURE\_V\_POINTER** :\
   the ID3D12Resource associated with the V plane of a YUV texture

With the vulkan renderer:

•  **SDL\_PROP\_TEXTURE\_VULKAN\_TEXTURE\_NUMBER** :\
   the VkImage associated with the texture

With the opengl renderer:

•  **SDL\_PROP\_TEXTURE\_OPENGL\_TEXTURE\_NUMBER** :\
   the GLuint texture associated with the texture

•  **SDL\_PROP\_TEXTURE\_OPENGL\_TEXTURE\_UV\_NUMBER** :\
   the GLuint texture associated with the UV plane of an NV12 texture

•  **SDL\_PROP\_TEXTURE\_OPENGL\_TEXTURE\_U\_NUMBER** :\
   the GLuint texture associated with the U plane of a YUV texture

•  **SDL\_PROP\_TEXTURE\_OPENGL\_TEXTURE\_V\_NUMBER** :\
   the GLuint texture associated with the V plane of a YUV texture

•  **SDL\_PROP\_TEXTURE\_OPENGL\_TEXTURE\_TARGET\_NUMBER** :\
   the GLenum for 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** :\
   the GLuint texture associated with the texture

•  **SDL\_PROP\_TEXTURE\_OPENGLES2\_TEXTURE\_UV\_NUMBER** :\
   the GLuint texture associated with the UV plane of an NV12 texture

•  **SDL\_PROP\_TEXTURE\_OPENGLES2\_TEXTURE\_U\_NUMBER** :\
   the GLuint texture associated with the U plane of a YUV texture

•  **SDL\_PROP\_TEXTURE\_OPENGLES2\_TEXTURE\_V\_NUMBER** :\
   the GLuint texture associated with the V plane of a YUV texture

•  **SDL\_PROP\_TEXTURE\_OPENGLES2\_TEXTURE\_TARGET\_NUMBER** :\
   the GLenum for the texture target ( **GL\_TEXTURE\_2D** , **GL\_TEXTURE\_EXTERNAL\_OES** , etc)

## FUNCTION PARAMETERS

- *texture*

  the texture to query.

## RETURN VALUE

( **SDL\_PropertiesID** ) Returns a valid property ID on success or 0 on failure; call  **SDL\_GetError** () for more information.

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.
