I have a SDL game with OpenGL. Everything is on one thread.
Now I want to move things to separate threads. I want to move rendering to separate thread.
I have read the internet and it seems that SDL does not allow to have OpenGL calls in another thread than main thread.
Are you serious? Dual-core CPUs were released in 2005. You had 20 years to add support but you didn’t. Is this a serious library? I paid you enough to get dual core support.
You can tell me that, I could just move all other aspects of game to another threads and the main thread would just be the rendering thread.
However this is bad because of reasons
- The architecture and code of my game will look bad due to this, this is a hack and not a real solution.
- How am I going to move everything to another threads if SDL has window message loop and input handling (keyboard, mouse, gamepad, joystick)? How to move them, then? You want my game to have input handling that is bound to graphics and FPS count? Especially this is a problem because number of FPS is not deterministic, sometimes GPU and OpenGL calls can hang the application for long time (when you fill the GPU with 100% work), so the player input in my game will be frozen for 50-100 milliseconds? Are you serious?
I thought this is serious product but now I don’t know what to do.
Maybe I will have to switch to different thing, or at least use different thing for input and use SDL for window creation and OpenGL. But this is bad, because the input library might support different platforms than SDL.
If this is open source then in theory I could add muti core support to SDL, but this is only theory, I don’t understand why SDL doesn’t support multithreading so I don’t know what to fix. I am not going to analyze 10k lines of code.
Do you all people just make single thread micro games?