Skip to content

Commit

Permalink
trying to fix build errors on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
wkjarosz committed Nov 27, 2023
1 parent 844c228 commit 0f25916
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
12 changes: 9 additions & 3 deletions gui/SampleViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down
4 changes: 3 additions & 1 deletion gui/SampleViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ using namespace linalg::aliases;
#include <string>
#include <vector>

using namespace std;
using std::ofstream;
using std::string;
using std::vector;

enum PointType
{
Expand Down
2 changes: 1 addition & 1 deletion gui/gui_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0f25916

Please sign in to comment.