From e6f22de66d0c903617b9d38aee1a353f8603e54e Mon Sep 17 00:00:00 2001 From: noy zini Date: Wed, 22 Jan 2025 15:22:57 +0200 Subject: [PATCH] replace SetTooltip with CustomTooltip --- common/d500-on-chip-calib.cpp | 2 +- common/dds-model.cpp | 8 ++-- common/device-model.cpp | 8 ++-- common/measurement.cpp | 2 +- common/model-views.h | 1 + common/on-chip-calib.cpp | 6 +-- common/output-model.cpp | 22 +++++----- common/realsense-ui-advanced-mode.h | 5 ++- common/stream-model.cpp | 40 +++++++++---------- common/ux-window.h | 1 + examples/align-advanced/rs-align-advanced.cpp | 2 +- examples/align-gl/rs-align-gl.cpp | 2 +- examples/align/rs-align.cpp | 2 +- .../post-processing/rs-post-processing.cpp | 2 +- third-party/imgui/realsense_imgui.cpp | 10 +++++ third-party/imgui/realsense_imgui.h | 1 + .../pointcloud-stitching/CMakeLists.txt | 4 +- .../rs-pointcloud-stitching.cpp | 13 ++++-- 18 files changed, 76 insertions(+), 55 deletions(-) diff --git a/common/d500-on-chip-calib.cpp b/common/d500-on-chip-calib.cpp index bed356d59f..e513ec8f4f 100644 --- a/common/d500-on-chip-calib.cpp +++ b/common/d500-on-chip-calib.cpp @@ -288,7 +288,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Abort Calibration Process"); + RsImGui::CustomTooltip("Abort Calibration Process"); } } diff --git a/common/dds-model.cpp b/common/dds-model.cpp index 60e124ff21..43d2480b1d 100644 --- a/common/dds-model.cpp +++ b/common/dds-model.cpp @@ -303,7 +303,7 @@ void dds_model::render_dds_config_window( ux_window & window, std::string & erro if( ImGui::IsItemHovered() ) { window.link_hovered(); - ImGui::SetTooltip( "%s", "Close without saving any changes" ); + RsImGui::CustomTooltip( "%s", "Close without saving any changes" ); } ImGui::SameLine(); if( ImGui::Button( "Factory Reset", ImVec2( button_width, 25 ) ) ) @@ -314,7 +314,7 @@ void dds_model::render_dds_config_window( ux_window & window, std::string & erro if( ImGui::IsItemHovered() ) { window.link_hovered(); - ImGui::SetTooltip( "%s", "Reset settings back to defult values" ); + RsImGui::CustomTooltip( "%s", "Reset settings back to defult values" ); } ImGui::SameLine(); RsImGui::RsImButton( @@ -329,7 +329,7 @@ void dds_model::render_dds_config_window( ux_window & window, std::string & erro if( ImGui::IsItemHovered() ) { window.link_hovered(); - ImGui::SetTooltip( "%s", "Revert to current configuration values" ); + RsImGui::CustomTooltip( "%s", "Revert to current configuration values" ); } ImGui::SameLine(); RsImGui::RsImButton( @@ -345,7 +345,7 @@ void dds_model::render_dds_config_window( ux_window & window, std::string & erro if( ImGui::IsItemHovered() ) { window.link_hovered(); - ImGui::SetTooltip( "%s", "Apply changes" ); + RsImGui::CustomTooltip( "%s", "Apply changes" ); } if( ImGui::BeginPopupModal( "No Changes Needed", NULL, ImGuiWindowFlags_AlwaysAutoResize ) ) { diff --git a/common/device-model.cpp b/common/device-model.cpp index 4f6224d049..a657518d90 100644 --- a/common/device-model.cpp +++ b/common/device-model.cpp @@ -1439,7 +1439,7 @@ namespace rs2 std::string tooltip = rsutils::string::from() << "Change the configuration of Ethernet based devices" << ( is_streaming ? " (Disabled while streaming)" : "" ); - ImGui::SetTooltip( "%s", tooltip.c_str() ); + RsImGui::CustomTooltip( "%s", tooltip.c_str() ); } } } @@ -2266,7 +2266,7 @@ namespace rs2 ImGui::PushFont(window.get_font()); ImGui::PushStyleColor(ImGuiCol_Text, light_grey); if (ImGui::IsItemHovered()) - ImGui::SetTooltip(" %s", ss.str().c_str()); + RsImGui::CustomTooltip(" %s", ss.str().c_str()); ImGui::PopStyleColor(); ImGui::PopFont(); } @@ -3227,7 +3227,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) - ImGui::SetTooltip("UV-Mapping calibration is used to improve UV-Mapping with specific target."); + RsImGui::CustomTooltip("UV-Mapping calibration is used to improve UV-Mapping with specific target."); } } } @@ -3279,7 +3279,7 @@ namespace rs2 // } //} //if (ImGui::IsItemHovered()) - // ImGui::SetTooltip("Focal length plus calibration is used to adjust camera focal length and principal points with specific target."); + // RsImGui::CustomTooltip("Focal length plus calibration is used to adjust camera focal length and principal points with specific target."); if (_calib_model.supports()) { diff --git a/common/measurement.cpp b/common/measurement.cpp index 0d480e5a56..a504073317 100644 --- a/common/measurement.cpp +++ b/common/measurement.cpp @@ -672,7 +672,7 @@ void measurement::show_tooltip(ux_window& win) { std::string tt = rsutils::string::from() << std::fixed << std::setprecision(3) << _picked.x << ", " << _picked.y << ", " << _picked.z << " meters"; - ImGui::SetTooltip("%s", tt.c_str()); + RsImGui::CustomTooltip("%s", tt.c_str()); } } } diff --git a/common/model-views.h b/common/model-views.h index 5d444dceff..6a485c846f 100644 --- a/common/model-views.h +++ b/common/model-views.h @@ -13,6 +13,7 @@ #include #include "opengl3.h" #include +#include #include #include #include diff --git a/common/on-chip-calib.cpp b/common/on-chip-calib.cpp index 9450d47d30..9a2cff9c46 100644 --- a/common/on-chip-calib.cpp +++ b/common/on-chip-calib.cpp @@ -2165,7 +2165,7 @@ namespace rs2 if (ImGui::Checkbox("Adjust both sides focal length", &restore)) get_manager().adjust_both_sides = (restore ? 1 : 0); if (ImGui::IsItemHovered()) - ImGui::SetTooltip("%s", "check = adjust both sides, uncheck = adjust right side only"); + RsImGui::CustomTooltip("%s", "check = adjust both sides, uncheck = adjust right side only"); }*/ // Deprecase OCC-Extended @@ -2176,13 +2176,13 @@ namespace rs2 //if (ImGui::RadioButton("OCC", (int*)&(get_manager().action), 1)) // get_manager().action = on_chip_calib_manager::RS2_CALIB_ACTION_ON_CHIP_CALIB; //if (ImGui::IsItemHovered()) - // ImGui::SetTooltip("%s", "On-chip calibration"); + // RsImGui::CustomTooltip("%s", "On-chip calibration"); //ImGui::SetCursorScreenPos({ float(x + 135), tmp_y }); //if (ImGui::RadioButton("OCC Extended", (int *)&(get_manager().action), 0)) // get_manager().action = on_chip_calib_manager::RS2_CALIB_ACTION_ON_CHIP_OB_CALIB; //if (ImGui::IsItemHovered()) - // ImGui::SetTooltip("%s", "On-Chip Calibration Extended"); + // RsImGui::CustomTooltip("%s", "On-Chip Calibration Extended"); ImGui::SetCursorScreenPos({ float(x + 9), float(y + height - ImGui::GetTextLineHeightWithSpacing() - 31) }); get_manager().host_assistance = (get_manager().device_name_string == std::string("Intel RealSense D457") ); // To be used for MIPI SKU only diff --git a/common/output-model.cpp b/common/output-model.cpp index 33bd8eb5c6..228be4a98d 100644 --- a/common/output-model.cpp +++ b/common/output-model.cpp @@ -189,7 +189,7 @@ bool output_model::round_indicator(ux_window& win, std::string icon, { highlighted = true; win.link_hovered(); - ImGui::SetTooltip("%s", tooltip.c_str()); + RsImGui::CustomTooltip("%s", tooltip.c_str()); } else highlighted = false; @@ -242,7 +242,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev if (ImGui::IsItemHovered()) { win.link_hovered(); - ImGui::SetTooltip("%s", "Open Debug Console Window"); + RsImGui::CustomTooltip("%s", "Open Debug Console Window"); } if (default_log_h.value() != 36) @@ -261,7 +261,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev if (ImGui::IsItemHovered()) { win.link_hovered(); - ImGui::SetTooltip("%s", "Collapse Debug Console Window"); + RsImGui::CustomTooltip("%s", "Collapse Debug Console Window"); } int h_val = (int)((win.height() - 100) / 2); @@ -315,7 +315,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev if (ImGui::IsItemHovered()) { win.link_hovered(); - ImGui::SetTooltip("%s", "Search through logs"); + RsImGui::CustomTooltip("%s", "Search through logs"); } ImGui::SameLine(); @@ -327,7 +327,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev } if( ImGui::IsItemHovered() ) { - ImGui::SetTooltip( "%s", "Set maximum number of log entries kept" ); + RsImGui::CustomTooltip( "%s", "Set maximum number of log entries kept" ); } ImGui::PopStyleColor(1); ImGui::SameLine(); @@ -421,8 +421,8 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev if (ImGui::IsItemHovered()) { win.link_hovered(); - if (enable_firmware_logs) ImGui::SetTooltip("%s", "Disable Firmware Logs"); - else ImGui::SetTooltip("%s", "Enable Firmware Logs"); + if (enable_firmware_logs) RsImGui::CustomTooltip("%s", "Disable Firmware Logs"); + else RsImGui::CustomTooltip("%s", "Enable Firmware Logs"); } ImGui::SameLine(); @@ -703,7 +703,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev } if( ImGui::IsItemHovered() ) { - ImGui::SetTooltip( "Collapse dashboard" ); + RsImGui::CustomTooltip( "Collapse dashboard" ); } // Animation of opening dashboard panel @@ -723,7 +723,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev } if( ImGui::IsItemHovered() ) { - ImGui::SetTooltip( "Open dashboard" ); + RsImGui::CustomTooltip( "Open dashboard" ); } ImGui::SetCursorPosX( cursor_pos_x ); @@ -772,7 +772,7 @@ void output_model::draw(ux_window& win, rect view_rect, device_models_list & dev if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Add one of the available stream dashboards to view"); + RsImGui::CustomTooltip("Add one of the available stream dashboards to view"); win.link_hovered(); } @@ -1125,7 +1125,7 @@ void stream_dashboard::draw_dashboard(ux_window& win, rect& r) } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Remove Dashboard from View"); + RsImGui::CustomTooltip("Remove Dashboard from View"); win.link_hovered(); } ImGui::PopStyleColor(); diff --git a/common/realsense-ui-advanced-mode.h b/common/realsense-ui-advanced-mode.h index b5e4c5b44f..569b28b1be 100644 --- a/common/realsense-ui-advanced-mode.h +++ b/common/realsense-ui-advanced-mode.h @@ -6,6 +6,7 @@ #include #include #include +#include #define TEXT_BUFF_SIZE 1024 @@ -31,7 +32,7 @@ bool* draw_edit_button(const char* id, T val, std::string*& val_str) } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Enter text-edit mode"); + RsImGui::CustomTooltip("Enter text-edit mode"); } ImGui::PopStyleColor(4); } @@ -48,7 +49,7 @@ bool* draw_edit_button(const char* id, T val, std::string*& val_str) } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Exit text-edit mode"); + RsImGui::CustomTooltip("Exit text-edit mode"); } ImGui::PopStyleColor(4); } diff --git a/common/stream-model.cpp b/common/stream-model.cpp index e0dae3454d..cd34e233cb 100644 --- a/common/stream-model.cpp +++ b/common/stream-model.cpp @@ -455,7 +455,7 @@ namespace rs2 ImGui::PushTextWrapPos(stream_rect.x + stream_rect.w - 32 * num_of_buttons - 5); ImGui::Text("%s", label.c_str()); if (tooltip != label && ImGui::IsItemHovered()) - ImGui::SetTooltip("%s", tooltip.c_str()); + RsImGui::CustomTooltip("%s", tooltip.c_str()); ImGui::PopTextWrapPos(); ImGui::SetCursorScreenPos({ stream_rect.x + stream_rect.w - 32 * num_of_buttons, stream_rect.y - top_bar_height }); @@ -472,7 +472,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Hide frame metadata"); + RsImGui::CustomTooltip("Hide frame metadata"); } ImGui::PopStyleColor(2); } @@ -484,7 +484,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Show frame metadata"); + RsImGui::CustomTooltip("Show frame metadata"); } } ImGui::SameLine(); @@ -503,7 +503,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Hide color map ruler"); + RsImGui::CustomTooltip("Hide color map ruler"); } ImGui::PopStyleColor(2); } @@ -516,7 +516,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Show color map ruler"); + RsImGui::CustomTooltip("Show color map ruler"); } } ImGui::SameLine(); @@ -538,7 +538,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Resume sensor"); + RsImGui::CustomTooltip("Resume sensor"); } ImGui::PopStyleColor(2); } @@ -556,7 +556,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Pause sensor"); + RsImGui::CustomTooltip("Pause sensor"); } } ImGui::SameLine(); @@ -573,7 +573,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Save snapshot"); + RsImGui::CustomTooltip("Save snapshot"); } ImGui::SameLine(); @@ -592,7 +592,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Hide stream info overlay"); + RsImGui::CustomTooltip("Hide stream info overlay"); } ImGui::PopStyleColor(2); @@ -608,7 +608,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Show stream info overlay"); + RsImGui::CustomTooltip("Show stream info overlay"); } } ImGui::SameLine(); @@ -626,7 +626,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Maximize stream to full-screen"); + RsImGui::CustomTooltip("Maximize stream to full-screen"); } ImGui::SameLine(); @@ -644,7 +644,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Restore tile view"); + RsImGui::CustomTooltip("Restore tile view"); } ImGui::PopStyleColor(2); @@ -665,7 +665,7 @@ namespace rs2 } if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("Stop this sensor"); + RsImGui::CustomTooltip("Stop this sensor"); } } @@ -732,11 +732,11 @@ namespace rs2 } else if (timestamp_domain == RS2_TIMESTAMP_DOMAIN_GLOBAL_TIME) { - ImGui::SetTooltip("Timestamp: Global Time"); + RsImGui::CustomTooltip("Timestamp: Global Time"); } else { - ImGui::SetTooltip("Timestamp: Hardware Clock"); + RsImGui::CustomTooltip("Timestamp: Hardware Clock"); } } @@ -766,7 +766,7 @@ namespace rs2 ImGui::Text("%s", label.c_str()); if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("%s", "Stream Resolution, Format"); + RsImGui::CustomTooltip("%s", "Stream Resolution, Format"); } ImGui::SameLine(); @@ -781,7 +781,7 @@ namespace rs2 ImGui::Text("%s", label.c_str()); if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("%s", "FPS is calculated based on timestamps and not viewer time"); + RsImGui::CustomTooltip("%s", "FPS is calculated based on timestamps and not viewer time"); } } @@ -1008,7 +1008,7 @@ namespace rs2 { if( ImGui::IsItemHovered() ) { - ImGui::SetTooltip( "%s", at.description.c_str() ); + RsImGui::CustomTooltip( "%s", at.description.c_str() ); } } @@ -1311,7 +1311,7 @@ namespace rs2 ImGui::Text("%s:", motion.name.c_str()); if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("%s", motion.toolTip.c_str()); + RsImGui::CustomTooltip("%s", motion.toolTip.c_str()); } ImGui::PopStyleColor(1); @@ -1412,7 +1412,7 @@ namespace rs2 ImGui::Text("%s:", pose.name.c_str()); if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("%s", pose.toolTip.c_str()); + RsImGui::CustomTooltip("%s", pose.toolTip.c_str()); } if (pose.fixedColor == false) diff --git a/common/ux-window.h b/common/ux-window.h index bd3d7a5f07..eca37c25b4 100644 --- a/common/ux-window.h +++ b/common/ux-window.h @@ -7,6 +7,7 @@ #include #include "imgui.h" +#include #include #include #include diff --git a/examples/align-advanced/rs-align-advanced.cpp b/examples/align-advanced/rs-align-advanced.cpp index 057eeb0397..822bef7c57 100644 --- a/examples/align-advanced/rs-align-advanced.cpp +++ b/examples/align-advanced/rs-align-advanced.cpp @@ -174,7 +174,7 @@ void render_slider(rect location, float& clipping_dist) auto slider_size = ImVec2(slider_window_width / 2, location.h - (pixels_to_buttom_of_stream_text * 2) - 20); RsImGui::VSliderFloat("##vslider", slider_size, &clipping_dist, 0.0f, 6.0f, "", 1.0f, true); if (ImGui::IsItemHovered()) - ImGui::SetTooltip("Depth Clipping Distance: %.3f", clipping_dist); + RsImGui::CustomTooltip("Depth Clipping Distance: %.3f", clipping_dist); ImGui::PopStyleColor(3); //Display bars next to slider diff --git a/examples/align-gl/rs-align-gl.cpp b/examples/align-gl/rs-align-gl.cpp index 6ec3f7abb4..d32c9f1005 100644 --- a/examples/align-gl/rs-align-gl.cpp +++ b/examples/align-gl/rs-align-gl.cpp @@ -168,7 +168,7 @@ void render_slider(rect location, float* alpha, direction* dir) ImGui::SliderFloat("##Slider", alpha, 0.f, 1.f); ImGui::PopItemWidth(); if (ImGui::IsItemHovered()) - ImGui::SetTooltip("Texture Transparancy: %.3f", *alpha); + RsImGui::CustomTooltip("Texture Transparancy: %.3f", *alpha); // Render direction checkboxes: bool to_depth = (*dir == direction::to_depth); diff --git a/examples/align/rs-align.cpp b/examples/align/rs-align.cpp index f7ad5b1731..de82cf7997 100644 --- a/examples/align/rs-align.cpp +++ b/examples/align/rs-align.cpp @@ -157,7 +157,7 @@ void render_slider(rect location, float* alpha, direction* dir) ImGui::SliderFloat("##Slider", alpha, 0.f, 1.f); ImGui::PopItemWidth(); if (ImGui::IsItemHovered()) - ImGui::SetTooltip("Texture Transparancy: %.3f", *alpha); + RsImGui::CustomTooltip("Texture Transparancy: %.3f", *alpha); // Render direction checkboxes: bool to_depth = (*dir == direction::to_depth); diff --git a/examples/post-processing/rs-post-processing.cpp b/examples/post-processing/rs-post-processing.cpp index f11ec46627..537411bf01 100644 --- a/examples/post-processing/rs-post-processing.cpp +++ b/examples/post-processing/rs-post-processing.cpp @@ -324,7 +324,7 @@ bool filter_slider_ui::render(const float3& location, bool enabled) ImGui::SetCursorPos({ location.x, location.y + 3 }); ImGui::TextUnformatted(label.c_str()); if (ImGui::IsItemHovered()) - ImGui::SetTooltip("%s", description.c_str()); + RsImGui::CustomTooltip("%s", description.c_str()); ImGui::SetCursorPos({ location.x + 170, location.y }); diff --git a/third-party/imgui/realsense_imgui.cpp b/third-party/imgui/realsense_imgui.cpp index b34f71b46f..dbfba16cc6 100644 --- a/third-party/imgui/realsense_imgui.cpp +++ b/third-party/imgui/realsense_imgui.cpp @@ -382,4 +382,14 @@ void RsImGui::CustomTooltip( const char * fmt, const char * label ) void RsImGui::CustomTooltip( const char * label ) { RsImGui::CustomTooltip( "%s", label ); +} + +void RsImGui::CustomTooltip(const char* fmt, float value) +{ + ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.90f, 0.90f, 0.90f, 1.00f)); + ImGui::PushStyleColor(ImGuiCol_PopupBg, ImVec4(0.05f, 0.05f, 0.10f, 0.90f)); + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(8, 8)); + ImGui::SetTooltip(fmt, value); + ImGui::PopStyleColor(2); + ImGui::PopStyleVar(); } \ No newline at end of file diff --git a/third-party/imgui/realsense_imgui.h b/third-party/imgui/realsense_imgui.h index c37d131c0d..3b305c579b 100644 --- a/third-party/imgui/realsense_imgui.h +++ b/third-party/imgui/realsense_imgui.h @@ -38,6 +38,7 @@ namespace RsImGui void RsImButton(const std::function &f, bool disable_button = false); void CustomTooltip( const char * fmt, const char * label ); void CustomTooltip( const char * label ); + void CustomTooltip(const char* fmt, float value); } // Macros to create unique function names using the current line number (__LINE__) diff --git a/wrappers/pointcloud/pointcloud-stitching/CMakeLists.txt b/wrappers/pointcloud/pointcloud-stitching/CMakeLists.txt index a578252cbc..c653d0f568 100644 --- a/wrappers/pointcloud/pointcloud-stitching/CMakeLists.txt +++ b/wrappers/pointcloud/pointcloud-stitching/CMakeLists.txt @@ -7,6 +7,8 @@ project(RealsenseExamplesPointcloudStitching) # Save the command line compile commands in the build output set(CMAKE_EXPORT_COMPILE_COMMANDS 1) +file(GLOB IMGUI_SOURCE "../../../third-party/imgui/*.cpp") + find_package(OpenGL) if(NOT OPENGL_FOUND) message(FATAL_ERROR "\n\n OpenGL package is missing!\n\n") @@ -15,7 +17,7 @@ endif() list(APPEND DEPENDENCIES ${OPENGL_LIBRARIES}) list(APPEND DEPENDENCIES glfw) -add_executable(rs-pointcloud-stitching rs-pointcloud-stitching.cpp rs-pointcloud-stitching.h ../../../examples/example.hpp ../../../third-party/imgui/imgui.cpp ../../../third-party/imgui/imgui_draw.cpp ../../../third-party/imgui/imgui_impl_glfw.cpp) +add_executable(rs-pointcloud-stitching rs-pointcloud-stitching.cpp rs-pointcloud-stitching.h ../../../examples/example.hpp ${IMGUI_SOURCE}) set_property(TARGET rs-pointcloud-stitching PROPERTY CXX_STANDARD 11) target_link_libraries( rs-pointcloud-stitching ${DEPENDENCIES} tclap ) include_directories(./ ../../../examples ../../../third-party/ ../../../third-party/imgui ../../../third-party/glfw/include ../../../common/res) diff --git a/wrappers/pointcloud/pointcloud-stitching/rs-pointcloud-stitching.cpp b/wrappers/pointcloud/pointcloud-stitching/rs-pointcloud-stitching.cpp index a157e4651d..2d0dc3fdc3 100644 --- a/wrappers/pointcloud/pointcloud-stitching/rs-pointcloud-stitching.cpp +++ b/wrappers/pointcloud/pointcloud-stitching/rs-pointcloud-stitching.cpp @@ -22,6 +22,7 @@ #include #include #include +#include using namespace std; using namespace rs_pointcloud_stitching; @@ -966,7 +967,7 @@ void CPointcloudStitcher::RecordButton(const ImVec2& window_size) if (ImGui::IsItemHovered()) { std::string record_button_hover_text = (_is_recording ? "Stop Recording" : "Start Recording"); - ImGui::SetTooltip("%s", record_button_hover_text.c_str()); + RsImGui::CustomTooltip("%s", record_button_hover_text.c_str()); } ImGui::End(); @@ -995,7 +996,7 @@ void CPointcloudStitcher::SaveFramesButton(const std::map(window_height*0.9), "RealSense Pointcloud-Stitching Example", tiles_in_row, tiles_in_col); - ImGui_ImplGlfw_Init(app, false); + ImGui::CreateContext(); + ImGui_ImplGlfw_InitForOpenGL(app, false); + ImGui_ImplOpenGL3_Init(); pc_stitcher.Run(app); pc_stitcher.StopSensors();