Migrate from SDL2 to SDL3 3.4.2#1847
Conversation
|
SDL_main is used incorrectly, it won't build on anything other than windows |
Thanks, I will try fix this. |
| return MotionSample{}; | ||
| } | ||
|
|
||
| std::scoped_lock lock(it->second.mtx); |
There was a problem hiding this comment.
Implementing the mutex like this isn't safe. Inserting or erasing elements in an unordered_map can invalidate iterators. So what can happen is that by the time you access it->second on this line of code it's already no longer valid because another thread modified m_motion_states.
I believe your reason for using a mutex per-entry is that it's more efficient? But in this case it's not worth the hassle. You can just use one global (static) mutex and then wrap the map and iterator access in that.
There was a problem hiding this comment.
You're right, I didn't consider it thoroughly enough.
|
Current build failure could be due to caching or some dependency still pulling in SDL2. I'll look into it |
|
the logs say theres a failure to upload nupkgs to the cemu nuget repository? |
|
It can be roughly determined that the Ubuntu build failure is due to a wayland conflict between wxWidgets and SDL3. Disable wayland feature in SDL3 can make a build success, but not sure what downside it is. |
|
quickfix, set the linker flag the build failure is because both SDL3 and WxGTK export a wayland symbol |
This should be fine. We only use the input part of SDL3. |
This comment was marked as resolved.
This comment was marked as resolved.
|
Remaining issues
|
Also fixed crashes if game controllers disconnect/reconnect more than 8 times. Tested under Windows, testing under Linux and Mac needed.