SDL_GetWindowICCProfile(3)
π SDL_GetWindowICCProfile π
okay so bestie, this is a page from the SDL3 FUNCTIONS manual β the SDL_GetWindowICCProfile(3) one β and it's genuinely one of the cutest little utility calls ever. let's get into it π«Ά
β¨ NAME β¨
SDL_GetWindowICCProfile β grab the raw ICC profile data for the screen your window is currently chillin' on. that's it, that's the whole job π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_video.h>
void * SDL_GetWindowICCProfile(SDL_Window *window, size_t *size);
like yes, it returns a void *, we know, we know, it's giving mysterious but it's fine π
π FUNCTION PARAMETERS π
windowβ the window you wanna query. that's your girl, that's the one you're asking about πsizeβ the size of the ICC profile. it's asize_t *, so she writes the size back out to you β¨
π¦ RETURN VALUE π¦
on success? you get the raw ICC profile data. slay. π
on failure? you get NULL. and not to be dramatic but you should then call SDL_GetError() for more info, because otherwise you're just standing there with a NULL and no answers π
real talk: when you're done with that data, you have to free it with SDL_free(). no cap. don't just leave it sitting there, that's a leak and leaks are not iconic π
π₯ THREAD SAFETY π₯
this function should only be called on the main thread. that's the vibe check. do not bring your worker threads to this party, it will not go well π
β AVAILABILITY β
this function is available since SDL 3.2.0. so if you're on something older... bestie, upgrade π§
π SEE ALSO π
(no SEE ALSO section on this one, she's a standalone queen, we move π)
mwah π that's the whole page. go get that ICC profile, free your memory, and only call it from the main thread, periodt. π
β with love, from the Simple Directmedia Layer crew, SDL 3.4.18 edition of SDL_GetWindowICCProfile(3) πβ¨
π¦ 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