-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathStackerDemo.cpp
More file actions
83 lines (69 loc) · 2.19 KB
/
StackerDemo.cpp
File metadata and controls
83 lines (69 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include "CppStackerBox.h"
static StackerUI g_stackerUI;
void init() {
{
StackerBoxRect rect;
rect.x = (int32)(rand() % 10);
rect.y = (int32)(rand() % 10);
rect.width = (int32)((rand() % 10) + 2);
rect.height = (int32)((rand() % 3) + 1);
CppStackerBox* el = new CppStackerBox;
el->validate();
el->rect = rect;
el->nodeType = NT_RGBOutput;
g_stackerUI.stackerBoxes.push_back(el);
}
/*
{
for (int32 i = 0; i < 1; ++i) {
StackerBoxRect rect;
rect.x = (int32)(rand() % 10);
rect.y = (int32)(rand() % 10);
rect.width = (int32)((rand() % 10) + 2);
rect.height = (int32)((rand() % 3) + 1);
bool isVariable = i < 2;
if (isVariable) {
CppStackerBoxFloat* el = new CppStackerBoxFloat;
el->rect = rect;
g_stackerUI.stackerBoxes.push_back(el);
}
else {
CppStackerBox* el = new CppStackerBox;
el->validate();
el->rect = rect;
el->nodeType = NT_Add;
el->name = "Node";
g_stackerUI.stackerBoxes.push_back(el);
}
}
}
*/
static CppAppConnection cppAppConnection;
g_stackerUI.setAppConnection(&cppAppConnection);
}
void stacker_demo() {
static bool first = true;
if (first) {
init();
first = false;
}
g_stackerUI.draw();
static bool show_demo_window = false;
if (ImGui::BeginMainMenuBar())
{
if (ImGui::BeginMenu("Windows"))
{
ImGui::MenuItem("Stacker Panel", 0, &g_stackerUI.showStackerPanelWindow);
ImGui::MenuItem("Stacker Code", 0, &g_stackerUI.showStackerCodeWindow);
ImGui::MenuItem("Stacker Properties", 0, &g_stackerUI.showStackerPropertiesWindow);
ImGui::Separator();
ImGui::MenuItem("Im Demo Window", 0, &show_demo_window);
ImGui::EndMenu();
}
ImGui::EndMainMenuBar();
}
// ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
// 1. Show the big demo window (Most of the sample code is in ImGui::ShowDemoWindow()! You can browse its code to learn more about Dear ImGui!).
if (show_demo_window)
ImGui::ShowDemoWindow(&show_demo_window);
}