diff --git a/include/openspace/gui/gui.h b/include/openspace/gui/gui.h index 73555d488e..a874b35147 100644 --- a/include/openspace/gui/gui.h +++ b/include/openspace/gui/gui.h @@ -50,7 +50,7 @@ public: void deinitializeGL(); bool mouseButtonCallback(int key, int action); - bool mouseWheelCallback(int position); + bool mouseWheelCallback(double position); bool keyCallback(int key, int action); bool charCallback(unsigned int character); diff --git a/include/openspace/interaction/interactionhandler.h b/include/openspace/interaction/interactionhandler.h index ac0995334b..2b56ebe881 100644 --- a/include/openspace/interaction/interactionhandler.h +++ b/include/openspace/interaction/interactionhandler.h @@ -108,8 +108,8 @@ public: void keyboardCallback(int key, int action); void mouseButtonCallback(int button, int action); - void mousePositionCallback(int x, int y); - void mouseScrollWheelCallback(int pos); + void mousePositionCallback(double x, double y); + void mouseScrollWheelCallback(double pos); double deltaTime() const; diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 2534fe497c..6a689f4400 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -650,7 +650,7 @@ void OpenSpaceEngine::keyboardCallback(int key, int action) { return; } - if (key == _console->commandInputButton() && (action == SGCT_PRESS || action == SGCT_REPEAT)) + if (static_cast(key) == _console->commandInputButton() && (action == SGCT_PRESS || action == SGCT_REPEAT)) _console->toggleVisibility(); if (!_console->isVisible()) { diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index ae5fb99fc4..110b80052c 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -294,7 +294,7 @@ bool GUI::mouseButtonCallback(int key, int action) { return consumeEvent; } -bool GUI::mouseWheelCallback(int position) { +bool GUI::mouseWheelCallback(double position) { ImGuiIO& io = ImGui::GetIO(); bool consumeEvent = io.WantCaptureMouse; if (consumeEvent) diff --git a/src/gui/guipropertycomponent.cpp b/src/gui/guipropertycomponent.cpp index 29643fc4ba..e8b34a2cff 100644 --- a/src/gui/guipropertycomponent.cpp +++ b/src/gui/guipropertycomponent.cpp @@ -112,7 +112,11 @@ namespace { static const int bufferSize = 256; static char buffer[bufferSize]; +#ifdef _MSC_VER + strcpy_s(buffer, p->value().length() + 1, p->value().c_str()); +#else strcpy(buffer, p->value().c_str()); +#endif ImGui::InputText((ownerName + "." + name).c_str(), buffer, bufferSize); std::string newValue(buffer); diff --git a/src/interaction/interactionhandler.cpp b/src/interaction/interactionhandler.cpp index f3d702cb4c..76668e95e0 100644 --- a/src/interaction/interactionhandler.cpp +++ b/src/interaction/interactionhandler.cpp @@ -405,15 +405,15 @@ void InteractionHandler::mouseButtonCallback(int button, int action) { _mouseController->button(MouseAction(action), MouseButton(button)); } -void InteractionHandler::mousePositionCallback(int x, int y) { +void InteractionHandler::mousePositionCallback(double x, double y) { if (_mouseController) // TODO Remap screen coordinates to [0,1] - _mouseController->move(float(x), float(y)); + _mouseController->move(static_cast(x), static_cast(y)); } -void InteractionHandler::mouseScrollWheelCallback(int pos) { +void InteractionHandler::mouseScrollWheelCallback(double pos) { if (_mouseController) - _mouseController->scrollWheel(pos); + _mouseController->scrollWheel(static_cast(pos)); } void InteractionHandler::orbit(const float &dx, const float &dy, const float &dz, const float &dist){ diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index 82ba9bcb80..c333d1ee29 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -331,6 +331,7 @@ function (handle_internal_modules) create_library_name(${module} libraryName) add_subdirectory(${OPENSPACE_MODULE_DIR}/${module}) target_link_libraries(OpenSpace ${libraryName}) + target_link_libraries(libOpenSpace ${libraryName}) create_define_name(${module} defineName) target_compile_definitions(libOpenSpace PUBLIC "${defineName}")