Skip to content
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
11 changes: 11 additions & 0 deletions example/color_node_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class ColorNodeEditor

void show()
{
static bool first_show = true;
// Update timer context
current_time_seconds = 0.001f * SDL_GetTicks();

Expand Down Expand Up @@ -640,14 +641,24 @@ class ColorNodeEditor
}
}

if (first_show)
{
ImGui::Dummy(ImVec2(500, 500));
}
ImGui::End();

// The color output window

const ImU32 color =
root_node_id_ != -1 ? evaluate(graph_, root_node_id_) : IM_COL32(255, 20, 147, 255);
ImGui::PushStyleColor(ImGuiCol_WindowBg, color);
ImGui::SetNextWindowPos(ImVec2(600, 60), ImGuiCond_FirstUseEver);
ImGui::Begin("output color");
if (first_show)
{
ImGui::Dummy(ImVec2(150, 150));
first_show = false;
}
ImGui::End();
ImGui::PopStyleColor();
}
Expand Down
7 changes: 6 additions & 1 deletion example/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ class HelloWorldNodeEditor

ImNodes::EndNode();
ImNodes::EndNodeEditor();

static bool first_show = true;
if (first_show)
{
ImGui::Dummy(ImVec2(500, 500));
first_show = false;
}
ImGui::End();
}
};
Expand Down
7 changes: 7 additions & 0 deletions example/multi_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct Editor
std::vector<Node> nodes;
std::vector<Link> links;
int current_id = 0;
bool first_show = true;
};

void show_editor(const char* editor_name, Editor& editor)
Expand Down Expand Up @@ -106,6 +107,11 @@ void show_editor(const char* editor_name, Editor& editor)
}
}

if (editor.first_show)
{
ImGui::Dummy(ImVec2(300, 300));
editor.first_show = false;
}
ImGui::End();
}

Expand All @@ -130,6 +136,7 @@ void NodeEditorInitialize()
void NodeEditorShow()
{
show_editor("editor1", editor1);
ImGui::SetNextWindowPos(ImVec2(400, 60), ImGuiCond_FirstUseEver);
show_editor("editor2", editor2);
}

Expand Down
6 changes: 6 additions & 0 deletions example/save_load.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ class SaveLoadEditor
}
}

static bool first_show = true;
if (first_show)
{
ImGui::Dummy(ImVec2(600, 500));
first_show = false;
}
ImGui::End();
}

Expand Down