SDL_GetSurfaceProperties(3)
π SDL_GetSurfaceProperties β the manual page, bestie edition π
okay so you're deep in the SDL3 FUNCTIONS section, page SDL_GetSurfaceProperties(3), and you need the tea on what properties a surface is holding. sit down, hydrate, let's go β¨
πΈ NAME πΈ
SDL_GetSurfaceProperties β grab the properties that are associated with a surface. that's it, that's the whole vibe π«Ά
β¨ SYNOPSIS β¨
#include <SDL3/SDL_surface.h>
SDL_PropertiesID SDL_GetSurfaceProperties(SDL_Surface *surface);
π¦ DESCRIPTION π¦
so SDL understands these properties, and here's the full rundown, no skips, no cuts π
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. it defaults to203for HDR10 surfaces and1.0for floating point surfaces. the range, she is ranging π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. defaults to0.0, which disables tone mapping. so like, off by default, periodt π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", whereNis a floating point scale factor applied in linear space, and"none", which disables tone mapping. defaults to"chrome". three whole options and they're all iconic πSDL_PROP_SURFACE_HOTSPOT_X_NUMBERβ the hotspot pixel offset from the left edge of the image, if this surface is being used as a cursor. cursor girlies, this one's for you πSDL_PROP_SURFACE_HOTSPOT_Y_NUMBERβ the hotspot pixel offset from the top edge of the image, if this surface is being used as a cursor. yeah it's the Y twin, they're a matching set πSDL_PROP_SURFACE_ROTATION_FLOATβ the number of degrees a surface's data is meant to be rotated clockwise to make the image right-side up. default0. this is used by the camera API, if a mobile device is oriented differently than what its camera provides (i.e. - the camera always provides portrait images but the phone is being held in landscape orientation). since SDL 3.4.0. not me rotating my whole phone just to read this π
π FUNCTION PARAMETERS π
surfaceβ theSDL_Surfacestructure to query. that's the one you're asking about, bestie π«Ά
π RETURN VALUE π
returns a valid property ID on success or 0 on failure. if it flops, call SDL_GetError() for more information. 0 is giving "we have nothing to say to you" energy π
π§ THREAD SAFETY π§
it is safe to call this function from any thread. yes bestie, ANY thread. go wild, no cap β
π AVAILABILITY π
this function is available since SDL 3.2.0. old enough to be trusted, young enough to be cute π
lowkey reminder: every single one of those property names is literal, character for character. copy them exactly or the compiler will simply not know her π₯
and that's the whole page, you ate it up. this came to you from Simple Directmedia Layer, SDL 3.4.18, SDL_GetSurfaceProperties(3) β mwah, go query something gorgeous, 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