-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boost-free C++11 (or TR1?) version of the clientkit C++ bindings #44
Comments
@yboger Can you get in touch with your game industry contacts to see if this is worthwhile? We were going for minimum compiler requirements/max compatibility on the API wrapper (it works at least as far back as VS 2008), hence the usage of Boost instead of C++11 or TR1, but what I've seen so far of game engines is that they're mostly all already using VS 2013. What I really wouldn't want to see is the (slightly unsafe, less usable) C API being used (or a wrapper re-invented) in C++ games/engines because the wrapper uses things that aren't allowed. |
what's the downside of using Boost? |
Well, it's a huge library collection, and apparently, at least according to that presentation, it's banned in some codebases. I think such a ban would have one of these causes:
It's the latter category of libraries we use in the wrappers, hence why we could basically replace/alternate the boost usage with newer C++ standards. They are close enough that we could maintain essentially the same interface, just letting the user pick whether they want to require Boost or a newer C++ compiler than VS2008. |
so if we got rid of Boost, we'd need VS2010? Something newer? On 4/1/2015 1:48 PM, Ryan Pavlik wrote:
|
The core internally uses boost and C++11, so it requires boost and VS2013 (or a not-ancient gcc or clang), which would be hard and counterproductive to change, so we're only talking about the C++ header-only API wrapper that takes the stable C API and makes it easier to use and safer. So I'd imagine that for the C++ wrapper on ClientKit, we'd have some
So, for ClientKit, 2010 easily, 2008SP1 with a little poking (sometimes getting things from TR1 is weird because of namespaces, and the scoped array replacement is less clear). Didn't realize so much was in TR1. |
Boost is only allowed as an optional dependency in the Dolphin Emulator project, which means that building Dolphin with OSVR support has to remain optional as long as there is a boost dependency in the Client Kit. C++11 is now widely support, no developer in VR would still be using an IDE as ancient as VS2005. I would argue that we should expand this issue to not just the ClientKit, but the entire OSVR Core since C++11 is already required there. Me and @feilen can definitely help you with the porting process. |
In the core, we do use more boost functionality than has been integrated in C++11, so I don't think removing boost from internal libraries is likely to be a wise (or easy) road. The C++ header-only wrappers for pluginkit and clientkit were designed for minimal dependencies, which is why they're C++98 and ancient boost headers, but I agree that at this point, at least for the client side (plugins are a whole other issue, since some vendors provide C++ APIs only so you have to match compilers on Windows) there's probably more devs who can use C++11 than Boost. Should be relatively straightforward to make this change and/or make it optional (behind ifdefs) since we're primarily using shared_ptr on the clientkit C++ headers, IIRC. Happy to offer guidance where needed, and review pull requests. |
I've posted about this issue on the mailing list: http://comments.gmane.org/gmane.comp.vr.osvr.devel/23 |
ad436ee7 Add creator's update windows SDK to search directories. 6c3c6b0a Merge branch 'nickbroon-improve-cppcheck' 58843aef CppcheckTargets: update credits 66fe49e8 CppcheckTargets: fix indents 7638eb54 Rename convenience target back to all_cppcheck from cppcheck. 35e68230 Update requirement info for CppcheckTargets 065ecf13 Merge branch 'improve-cppcheck' of https://github.com/nickbroon/cmake-modules into nickbroon-improve-cppcheck 98e28d2f Merge pull request #44 from AlessandroMenti/boost-test-targets-check-fix 82e5a292 Merge pull request #45 from noma/master deca4d3d Added git_local_changes() to GetGitRevisionDescription.cmake 08987b54 Update to stash map config to make it actually properly push and pop c330929f New module: stash map config. 8a18a1b4 Add new InstallDebugSymbols module. 30573d30 Small JsonCpp cleanup. 2ef829da Fix "no target to set property" error in FindJsonCpp 997754e2 Fix wrong check in BoostTestTargets.cmake 41e16511 libusb1 enhancements from VRPN 7ef3955d Fixes to FindWindowsSDK so it doesn't return TRUE as the first element of every directory list. a4974827 Fix indentation and accidentally-left-in debug messages in FindDirectShow b43b5e27 Bug fix in backported FindGit. 7c8c7925 Add a greatly enhanced FindGLEW (for CMake 2.8.12+), based on the upstream. ec0c486f Add the Windows 10 1607 "Anniversary Update" SDK version to the WindowsSDK list. 7dc51986 Fix building against jsoncpp when the build types don't exactly match. 1932f85b Return to more conservative default settings. b1d2d88b cppcheck will check C as well as C++ a4561deb Improvements on cppcheck git-subtree-dir: cmake git-subtree-split: ad436ee7be33ca291a59866a173b777b0e2d81ce
Per a presentation I read re: Ubisoft's dev. of games in C++ , they don't allow boost in their main tree, and I'm sure they're not the only ones. The main reason we're using Boost in the clientkit bindings is for relatively simple things (shared_ptr, etc) that we could get if the user agreed to a higher C++ standard (Not sure if TR1 suffices or if C++11 is needed, offhand)
(presentation is here: https://github.com/CppCon/CppCon2014/blob/master/Presentations/C%2B%2B%20in%20Huge%20AAA%20Games/C%2B%2B%20in%20Huge%20AAA%20Games%20-%20Nicolas%20Fleury%20-%20CppCon%202014.pdf I just read the slides, didn't watch the video)
The text was updated successfully, but these errors were encountered: