sdlGetSurfaceProperties function

int sdlGetSurfaceProperties(
  1. Pointer<SdlSurface> surface
)

Get the properties associated with a surface.

The following properties are understood by SDL:

  • SDL_PROP_SURFACE_SDR_WHITE_POINT_FLOAT: for HDR10 and floating point surfaces, this defines the value of 100% diffuse white, with higher values being displayed in the High Dynamic Range headroom. This defaults to 203 for HDR10 surfaces and 1.0 for floating point surfaces.
  • SDL_PROP_SURFACE_HDR_HEADROOM_FLOAT: for HDR10 and floating point surfaces, this defines the maximum dynamic range used by the content, in terms of the SDR white point. This defaults to 0.0, which disables tone mapping.
  • SDL_PROP_SURFACE_TONEMAP_OPERATOR_STRING: the tone mapping operator used when compressing from a surface with high dynamic range to another with lower dynamic range. Currently this supports "chrome", which uses the same tone mapping that Chrome uses for HDR content, the form "*=N", where N is a floating point scale factor applied in linear space, and "none", which disables tone mapping. This defaults to "chrome".

\param surface the SDL_Surface structure to query. \returns a valid property ID on success or 0 on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.1.3.

extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surface *surface)

Implementation

int sdlGetSurfaceProperties(Pointer<SdlSurface> surface) {
  final sdlGetSurfacePropertiesLookupFunction = libSdl3.lookupFunction<
      Uint32 Function(Pointer<SdlSurface> surface),
      int Function(Pointer<SdlSurface> surface)>('SDL_GetSurfaceProperties');
  return sdlGetSurfacePropertiesLookupFunction(surface);
}