Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some sample build issues and update imgui #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cmake_minimum_required(VERSION 3.1)
project(ImNodes)

set(CMAKE_CXX_STANDARD 14)
set(IMNODES_IMGUI_VERSION "1.85" CACHE STRING "ImGui version to use for building sample,")
set(IMNODES_IMGUI_VERSION "1.90.4" CACHE STRING "ImGui version to use for building sample,")

if (NOT IMGUI_DIR)
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
Expand All @@ -48,7 +48,7 @@ if (NOT EXISTS "${IMGUI_DIR}/CMakeLists.txt")
endif ()

set(IMGUI_DISABLE_OBSOLETE_FUNCTIONS ON)
add_subdirectory(${IMGUI_DIR})
add_subdirectory(${IMGUI_DIR} EXCLUDE_FROM_ALL)

# Warnings.
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
Expand Down
4 changes: 2 additions & 2 deletions sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ std::vector<MyNode*> nodes;
namespace ImGui
{

void ShowDemoWindow(bool*)
inline void ShowDemoWindow(bool*)
{
// Canvas must be created after ImGui initializes, because constructor accesses ImGui style to configure default colors.
static ImNodes::Ez::Context* context = ImNodes::Ez::CreateContext();
Expand Down Expand Up @@ -175,7 +175,7 @@ void ShowDemoWindow(bool*)
// Node rendering is done. This call will render node background based on size of content inside node.
ImNodes::Ez::EndNode();

if (node->Selected && ImGui::IsKeyPressedMap(ImGuiKey_Delete) && ImGui::IsWindowFocused())
if (node->Selected && ImGui::IsKeyPressed(ImGuiKey_Delete) && ImGui::IsWindowFocused())
{
// Deletion order is critical: first we delete connections to us
for (auto& connection : node->Connections)
Expand Down