From 0f259168d4947c7e422449fe0c6197f31d73fad5 Mon Sep 17 00:00:00 2001 From: Wojciech Jarosz Date: Mon, 27 Nov 2023 13:53:28 +0100 Subject: [PATCH] trying to fix build errors on windows --- gui/SampleViewer.cpp | 12 +++++++++--- gui/SampleViewer.h | 4 +++- gui/gui_app.cpp | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/gui/SampleViewer.cpp b/gui/SampleViewer.cpp index 7bebc89..a273fa4 100644 --- a/gui/SampleViewer.cpp +++ b/gui/SampleViewer.cpp @@ -10,6 +10,12 @@ namespace fs = std::filesystem; using namespace linalg::ostream_overloads; +using std::cerr; +using std::cout; +using std::endl; +using std::ofstream; +using std::to_string; + #include "hello_imgui/hello_imgui.h" #include "imgui.h" #include "imgui_internal.h" @@ -272,7 +278,7 @@ int2 SampleViewer::get_draw_range() const { int start = 0, count = m_point_count; if (m_subset_by_coord) - count = min(count, m_subset_count); + count = std::min(count, m_subset_count); else if (m_subset_by_index) { start = m_first_draw_point; @@ -422,8 +428,8 @@ void SampleViewer::draw_editor() if (accept_keys && (ImGui::IsKeyPressed(ImGuiKey_LeftArrow) || ImGui::IsKeyPressed(ImGuiKey_RightArrow))) { m_target_point_count = - max(1u, ImGui::IsKeyPressed(ImGuiKey_RightArrow) ? roundUpPow2(m_target_point_count + 1) - : roundDownPow2(m_target_point_count - 1)); + std::max(1u, ImGui::IsKeyPressed(ImGuiKey_RightArrow) ? roundUpPow2(m_target_point_count + 1) + : roundDownPow2(m_target_point_count - 1)); update_GPU_points(); update_GPU_grids(); } diff --git a/gui/SampleViewer.h b/gui/SampleViewer.h index 71f21dd..e8daca2 100644 --- a/gui/SampleViewer.h +++ b/gui/SampleViewer.h @@ -39,7 +39,9 @@ using namespace linalg::aliases; #include #include -using namespace std; +using std::ofstream; +using std::string; +using std::vector; enum PointType { diff --git a/gui/gui_app.cpp b/gui/gui_app.cpp index 8c666ac..253b9ed 100644 --- a/gui/gui_app.cpp +++ b/gui/gui_app.cpp @@ -129,7 +129,7 @@ void GUIApp::register_callbacks() void GUIApp::cursor_pos_event(double x, double y) { - int2 p{x, y}; + int2 p{int(x), int(y)}; #if defined(_WIN32) || defined(__linux__) || defined(EMSCRIPTEN) p = int2(float2(p) / m_pixel_ratio);