minVR updates (#908)

* changed libopenspace cmake module name to openspace-core
* change mouse button callback to include modifiers
* added some new ghoul initialization from the non-MinVR main.cpp
* Add GLFW as an external dependency for MinVR
This commit is contained in:
David Laidlaw
2019-07-16 07:51:39 -04:00
committed by Alexander Bock
parent 6d725a7d50
commit 64f8793ea0
4 changed files with 21 additions and 2 deletions

3
.gitmodules vendored
View File

@@ -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

View File

@@ -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

View File

@@ -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 {