diff --git a/.gitmodules b/.gitmodules index 4311e7851a..1bdc897bbd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -26,3 +26,6 @@ [submodule "modules/fitsfilereader/ext/cfitsio"] path = modules/fitsfilereader/ext/cfitsio url = https://github.com/OpenSpace/cfitsio.git +[submodule "apps/OpenSpace-MinVR/ext/glfw"] + path = apps/OpenSpace-MinVR/ext/glfw + url = https://github.com/opensgct/glfw diff --git a/apps/OpenSpace-MinVR/CMakeLists.txt b/apps/OpenSpace-MinVR/CMakeLists.txt index 656da9b194..f58a2a13cc 100644 --- a/apps/OpenSpace-MinVR/CMakeLists.txt +++ b/apps/OpenSpace-MinVR/CMakeLists.txt @@ -50,7 +50,7 @@ target_include_directories(OpenSpace-MinVR PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/ex target_include_directories(OpenSpace-MinVR PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/ext/minvr/external/GLFW/src/include) -target_link_libraries(OpenSpace-MinVR libOpenSpace MinVR) +target_link_libraries(OpenSpace-MinVR openspace-core MinVR) # Web Browser and Web gui # Why not put these in the module's path? Because they do not have access to the diff --git a/apps/OpenSpace-MinVR/ext/glfw b/apps/OpenSpace-MinVR/ext/glfw new file mode 160000 index 0000000000..7ef34eb06d --- /dev/null +++ b/apps/OpenSpace-MinVR/ext/glfw @@ -0,0 +1 @@ +Subproject commit 7ef34eb06de54dd9186d3d21a401b2ef819b59e7 diff --git a/apps/OpenSpace-MinVR/main.cpp b/apps/OpenSpace-MinVR/main.cpp index b4cde8364e..1b309b4b8d 100644 --- a/apps/OpenSpace-MinVR/main.cpp +++ b/apps/OpenSpace-MinVR/main.cpp @@ -200,7 +200,14 @@ void Handler::onVREvent(const VRDataIndex& eventData) { if (button == MouseButton::Right && action == MouseAction::Press) { windowingGlobals.mouseButtons |= 1 << 2; } - global::openSpaceEngine.mouseButtonCallback(button, action); + + using KM = KeyModifier; + KM mod = KM::NoModifier; + mod |= keyboardState.modifierShift ? KM::Shift : KM::NoModifier; + mod |= keyboardState.modifierCtrl ? KM::Control : KM::NoModifier; + mod |= keyboardState.modifierAlt ? KM::Alt : KM::NoModifier; + + global::openSpaceEngine.mouseButtonCallback(button, action, mod); } } @@ -341,6 +348,14 @@ int main(int argc, char** argv) { ghoul::initialize(); + // Register the path of the executable, + // to make it possible to find other files in the same directory. + FileSys.registerPathToken( + "${BIN}", + ghoul::filesystem::File(absPath(argv[0])).directoryName(), + ghoul::filesystem::FileSystem::Override::Yes + ); + // Create the OpenSpace engine and get arguments for the SGCT engine std::string windowConfiguration; try {