Can I use SDL_CreateThread before calling SDL_Init?

On linux it appears I can call SDL_CreateThread before calling SDL_Init. I don’t see a thread option in SDL_INIT_*. If I must call SDL_Init whats the minimum flags I can pass in?

I’m using SDL2 for now but plan to do the same in 3

Alternatively I can use C++ threads, but I prefer the SDL API

Not everything that needs SDL_Init gets its own flag (the flags are more to make sure we don’t try to touch hardware and resources you don’t plan to use through SDL), but afaik, SDL_CreateThread works on all platforms before SDL_Init.

But I’m also curious why it must be used before SDL_Init is called in your program.

I’m writing an IDE. https://bold-edit.com/

I don’t need to call it before SDL_Init but to me the most logical place would be call it immediately after I process the command line flags. That’s really it. Looking at my code after a refactor it looks like only unit test sit between create thread and init so I should call it after sdl init.

I noticed SDL_Init with video and events is about 50ms. When I did openGL (on linux, without sdl) creating a GL context is something like 200+MS. I don’t suppose I have any other options? vulkan seemed to be roughly the same. 300ms startup time for a hardware accelerated editor is plenty fast