axpbox
axpbox copied to clipboard
Port AXPbox from POCO to C++11 (or Qt Core 5)
Advantages:
- Makes the codebase smaller
- Qt is more widely used, so it should be more stable
- It supports events
- Qt GUI backend may be used to replace SDL and X11
Disadvantages:
- Doesn't work on more exotic platforms
This may be unnecessary, since C++11 provides most features and should have comparable portability.
I saw that you've refactored a few threads to qt threads. Could this be also be done with std::threads?
I've got limited experience with std threads, here is an example of my code : https://github.com/RaymiiOrg/c_ookieclicker/blob/f3cb8a5adadcfd7a496bc7c49b0be8daa7022824/src/Game/src/GameLoop.cpp#L14 and a bit lower there are mutexes and lock guards.
At work we use a weird form of threading evolved from the Nucleus microcontroller code, not much help here.
For qt, I personally like the idea to use it for an actual gui, but if you can avoid pulling it in as a core dependency, it would help with platform support. (Optional gui compile).
What more tasks do you envision for the removal of poco? Just piece by piece everything in the base folder?
Basically yes, remove the classes one by one and replace their use with native C++11 ones (which of course were unavailable to es40 authors in 2007). This will also make possible to use things like std::lock_guard and std::atomic instead of plain mutexes.
Yes, it definitely can be done with std threads, I'm working on it right now - it's a little bit tricky, but should work.
I'm also treating this as an opportunity to learn how C++ threading works (and multithreaded applications in general), since I have no experience with this so far.
Migrated a bunch of components to std threads, no sign of a problem so far. Once POCO CThread is removed I'll do some more testing and if everything works push the change.