Feature/integrated touchserver (#1015)

* WINDOWS: Touch server integrated into module

The touch server functionality has been integrated into the touch module
which is enabled by-default when the touch module is used on a windows
build.
The touch-hook checks for a connected digitizer (pen or touchscreen, but
I haven't tested pen)

This commit should also fix two potential low-risk race conditions in
the tuioear.cpp file.

* Added comment regarding which window we use

* Added copyright notice on the win32_touch files

Also changed from #pragma to #ifndef

* Fixes based on review

- Added anonymous namespace
- Put win32hook in openspace namespace
- Fixed indentations and linebreaks
- Fixed an issue regarding global state deinitialization
This commit is contained in:
Mikael Pettersson
2019-12-02 14:09:15 +01:00
committed by GitHub
parent c469dd78a0
commit a33057d830
9 changed files with 253 additions and 11 deletions
+10
View File
@@ -1042,6 +1042,16 @@ void setSgctDelegateFunctions() {
sgct::SGCTWindow* w = sgct::Engine::instance()->getWindowPtr(0);
w->setHorizFieldOfView(hFovDeg);
};
#ifdef WIN32
sgctDelegate.getNativeWindowHandle = [](size_t windowIndex) -> void* {
sgct::SGCTWindow* w = sgct::Engine::instance()->getWindowPtr(windowIndex);
if(w) {
HWND hWnd = glfwGetWin32Window(w->getWindowHandle());
return reinterpret_cast<void*>(hWnd);
}
return nullptr;
};
#endif // WIN32
sgctDelegate.frustumMode = []() {
using FM = sgct_core::Frustum::FrustumMode;
switch (sgct::Engine::instance()->getCurrentFrustumMode()) {