SDL_ThreadFunction(3type)
π SDL_ThreadFunction π
okay bestie, welcome to the SDL_ThreadFunction(3type) page β it's a datatype situation, part of the SDL3 datatypes era, and honestly? it's giving "tiny but crucial" π
β¨ NAME β¨
SDL_ThreadFunction β the function you hand over to SDL_CreateThread() so it can be the entry point of your brand new thread. like, it's literally the first thing your baby thread does with its life π¦
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_thread.h>
typedef int (SDLCALL *SDL_ThreadFunction) (void *data);
look at that signature. look at it. int return, void *data in, SDLCALL doing its little calling-convention moment. iconic, no notes π
π FUNCTION PARAMETERS π
dataβ literally just whatever you passed asdatatoSDL_CreateThread(). that's it, that's the whole vibe. it comes back to you here, same as you sent it π«
β RETURN VALUE β
you return a value, and that value can get reported back out through SDL_WaitThread(). so likeβ¦ your return value isn't shouting into the void, it gets picked up later. main character energy fr fr π
π AVAILABILITY π
this datatype has been available since SDL 3.2.0. so if you're on anything older, bestie, it's not here yet π
lowkey reminder: keep that signature exact.int,SDLCALL,void *data. don't get creative with it, the compiler will absolutely clock you π
mwah π that's the whole page. written up by the lovely folks over at Simple Directmedia Layer, tagged SDL 3.4.18, and filed under SDL_ThreadFunction(3type) β go make some threads, you absolute icon π«Άβ¨
π¦ 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