mirror of https://github.com/bkaradzic/bgfx
Removed use of obsolete ImGui API.
This commit is contained in:
parent
2e819904e2
commit
907f835881
|
@ -6,6 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
|
||||
//---- Define your own ImVector<> type if you don't want to use the provided implementation defined in imgui.h
|
||||
//#include <vector>
|
||||
//#define ImVector std::vector
|
||||
|
|
|
@ -712,7 +712,7 @@ ImGuiStyle::ImGuiStyle()
|
|||
{
|
||||
Alpha = 1.0f; // Global alpha applies to everything in ImGui
|
||||
WindowPadding = ImVec2(8,8); // Padding within a window
|
||||
WindowRounding = 9.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows
|
||||
WindowRounding = 7.0f; // Radius of window corners rounding. Set to 0.0f to have rectangular windows
|
||||
WindowBorderSize = 0.0f; // Thickness of border around windows. Generally set to 0.0f or 1.0f. Other values not well tested.
|
||||
WindowMinSize = ImVec2(32,32); // Minimum window size
|
||||
WindowTitleAlign = ImVec2(0.0f,0.5f);// Alignment for title bar text
|
||||
|
@ -10349,7 +10349,7 @@ bool ImGui::SplitterBehavior(ImGuiID id, const ImRect& bb, ImGuiAxis axis, float
|
|||
|
||||
// Render
|
||||
const ImU32 col = GetColorU32(held ? ImGuiCol_SeparatorActive : hovered ? ImGuiCol_SeparatorHovered : ImGuiCol_Separator);
|
||||
RenderFrame(bb_render.Min, bb_render.Max, col, true, g.Style.FrameRounding);
|
||||
window->DrawList->AddRectFilled(bb_render.Min, bb_render.Max, col, g.Style.FrameRounding);
|
||||
|
||||
return held;
|
||||
}
|
||||
|
|
|
@ -281,6 +281,7 @@ struct IMGUI_API ImRect
|
|||
void Translate(const ImVec2& v) { Min.x += v.x; Min.y += v.y; Max.x += v.x; Max.y += v.y; }
|
||||
void ClipWith(const ImRect& clip) { if (Min.x < clip.Min.x) Min.x = clip.Min.x; if (Min.y < clip.Min.y) Min.y = clip.Min.y; if (Max.x > clip.Max.x) Max.x = clip.Max.x; if (Max.y > clip.Max.y) Max.y = clip.Max.y; }
|
||||
void Floor() { Min.x = (float)(int)Min.x; Min.y = (float)(int)Min.y; Max.x = (float)(int)Max.x; Max.y = (float)(int)Max.y; }
|
||||
bool IsFinite() const { return Min.x != FLT_MAX; }
|
||||
ImVec2 GetClosestPoint(ImVec2 p, bool on_edge) const
|
||||
{
|
||||
if (!on_edge && Contains(p))
|
||||
|
|
|
@ -1,232 +0,0 @@
|
|||
// Creating a node graph editor for ImGui
|
||||
// Quick demo, not production code!
|
||||
// See https://github.com/ocornut/imgui/issues/306
|
||||
// v0.01
|
||||
// Animated gif: https://cloud.githubusercontent.com/assets/8225057/9472357/c0263c04-4b4c-11e5-9fdf-2cd4f33f6582.gif
|
||||
|
||||
#include <math.h>
|
||||
#include "imgui.h"
|
||||
|
||||
// NB: You can use math functions/operators on ImVec2 if you #define IMGUI_DEFINE_MATH_OPERATORS and #include "imgui_internal.h"
|
||||
// Here we only declare simple +/- operators so others don't leak into the demo code.
|
||||
static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x+rhs.x, lhs.y+rhs.y); }
|
||||
static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x-rhs.x, lhs.y-rhs.y); }
|
||||
|
||||
struct Node
|
||||
{
|
||||
int ID;
|
||||
char Name[32];
|
||||
ImVec2 Pos, Size;
|
||||
float Value;
|
||||
int InputsCount, OutputsCount;
|
||||
|
||||
Node(int id, const char* name, const ImVec2& pos, float value, int inputs_count, int outputs_count) { ID = id; strncpy(Name, name, 31); Name[31] = 0; Pos = pos; Value = value; InputsCount = inputs_count; OutputsCount = outputs_count; }
|
||||
|
||||
ImVec2 GetInputSlotPos(int slot_no) const { return ImVec2(Pos.x, Pos.y + Size.y * ((float)slot_no+1) / ((float)InputsCount+1)); }
|
||||
ImVec2 GetOutputSlotPos(int slot_no) const { return ImVec2(Pos.x + Size.x, Pos.y + Size.y * ((float)slot_no+1) / ((float)OutputsCount+1)); }
|
||||
};
|
||||
|
||||
struct NodeLink
|
||||
{
|
||||
int InputIdx, InputSlot, OutputIdx, OutputSlot;
|
||||
|
||||
NodeLink(int input_idx, int input_slot, int output_idx, int output_slot) { InputIdx = input_idx; InputSlot = input_slot; OutputIdx = output_idx; OutputSlot = output_slot; }
|
||||
};
|
||||
|
||||
// Really dumb data structure provided for the example.
|
||||
// Note that we storing links are INDICES (not ID) to make example code shorter, obviously a bad idea for any general purpose code.
|
||||
void ShowExampleAppCustomNodeGraph(bool* opened)
|
||||
{
|
||||
ImGui::SetNextWindowSize(ImVec2(700,600), ImGuiSetCond_FirstUseEver);
|
||||
if (!ImGui::Begin("Example: Custom Node Graph", opened))
|
||||
{
|
||||
ImGui::End();
|
||||
return;
|
||||
}
|
||||
|
||||
static ImVector<Node> nodes;
|
||||
static ImVector<NodeLink> links;
|
||||
static bool inited = false;
|
||||
static ImVec2 scrolling = ImVec2(0.0f, 0.0f);
|
||||
static int node_selected = -1;
|
||||
if (!inited)
|
||||
{
|
||||
nodes.push_back(Node(0, "MainTex", ImVec2(40,50), 0.5f, 1, 1));
|
||||
nodes.push_back(Node(1, "BumpMap", ImVec2(40,150), 0.42f, 1, 1));
|
||||
nodes.push_back(Node(2, "Combine", ImVec2(270,80), 1.0f, 2, 2));
|
||||
links.push_back(NodeLink(0, 0, 2, 0));
|
||||
links.push_back(NodeLink(1, 0, 2, 1));
|
||||
inited = true;
|
||||
}
|
||||
|
||||
// Draw a list of nodes on the left side
|
||||
bool open_context_menu = false;
|
||||
int node_hovered_in_list = -1;
|
||||
int node_hovered_in_scene = -1;
|
||||
ImGui::BeginChild("node_list", ImVec2(100,0));
|
||||
ImGui::Text("Nodes");
|
||||
ImGui::Separator();
|
||||
for (int node_idx = 0; node_idx < nodes.Size; node_idx++)
|
||||
{
|
||||
Node* node = &nodes[node_idx];
|
||||
ImGui::PushID(node->ID);
|
||||
if (ImGui::Selectable(node->Name, node->ID == node_selected))
|
||||
node_selected = node->ID;
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
node_hovered_in_list = node->ID;
|
||||
open_context_menu |= ImGui::IsMouseClicked(1);
|
||||
}
|
||||
ImGui::PopID();
|
||||
}
|
||||
ImGui::EndChild();
|
||||
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
const float NODE_SLOT_RADIUS = 4.0f;
|
||||
const ImVec2 NODE_WINDOW_PADDING(8.0f, 8.0f);
|
||||
|
||||
// Create our child canvas
|
||||
ImGui::Text("Hold middle mouse button to scroll (%.2f,%.2f)", scrolling.x, scrolling.y);
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(1,1));
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0,0));
|
||||
ImGui::PushStyleColor(ImGuiCol_ChildWindowBg, (ImVec4)ImColor(40,40,40,200));
|
||||
ImGui::BeginChild("scrolling_region", ImVec2(0,0), true, ImGuiWindowFlags_NoScrollbar|ImGuiWindowFlags_NoMove);
|
||||
ImGui::PushItemWidth(120.0f);
|
||||
|
||||
ImDrawList* draw_list = ImGui::GetWindowDrawList();
|
||||
draw_list->ChannelsSplit(2);
|
||||
ImVec2 offset = ImGui::GetCursorScreenPos() - scrolling;
|
||||
|
||||
// Display links
|
||||
draw_list->ChannelsSetCurrent(0); // Background
|
||||
for (int link_idx = 0; link_idx < links.Size; link_idx++)
|
||||
{
|
||||
NodeLink* link = &links[link_idx];
|
||||
Node* node_inp = &nodes[link->InputIdx];
|
||||
Node* node_out = &nodes[link->OutputIdx];
|
||||
|
||||
#if 1
|
||||
// Hermite spline
|
||||
// TODO: move to ImDrawList path API
|
||||
ImVec2 p1 = offset+node_inp->GetOutputSlotPos(link->InputSlot);
|
||||
ImVec2 t1 = ImVec2(+80.0f, 0.0f);
|
||||
ImVec2 p2 = offset+node_out->GetInputSlotPos(link->OutputSlot);
|
||||
ImVec2 t2 = ImVec2(+80.0f, 0.0f);
|
||||
const int STEPS = 12;
|
||||
for (int step = 0; step <= STEPS; step++)
|
||||
{
|
||||
float t = (float)step / (float)STEPS;
|
||||
float h1 = +2*t*t*t - 3*t*t + 1.0f;
|
||||
float h2 = -2*t*t*t + 3*t*t;
|
||||
float h3 = t*t*t - 2*t*t + t;
|
||||
float h4 = t*t*t - t*t;
|
||||
draw_list->PathLineTo(ImVec2(h1*p1.x + h2*p2.x + h3*t1.x + h4*t2.x, h1*p1.y + h2*p2.y + h3*t1.y + h4*t2.y));
|
||||
}
|
||||
draw_list->PathStroke(ImColor(200,200,100), false, 3.0f);
|
||||
#else
|
||||
draw_list->AddLine(offset+node_inp->GetOutputSlotPos(link->InputSlot), offset+node_out->GetInputSlotPos(link->OutputSlot), ImColor(200,200,100), 3.0f);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Display nodes
|
||||
for (int node_idx = 0; node_idx < nodes.Size; node_idx++)
|
||||
{
|
||||
Node* node = &nodes[node_idx];
|
||||
ImGui::PushID(node->ID);
|
||||
ImVec2 node_rect_min = offset + node->Pos;
|
||||
|
||||
// Display node contents first
|
||||
draw_list->ChannelsSetCurrent(1); // Foreground
|
||||
bool old_any_active = ImGui::IsAnyItemActive();
|
||||
ImGui::SetCursorScreenPos(node_rect_min + NODE_WINDOW_PADDING);
|
||||
ImGui::BeginGroup(); // Lock horizontal position
|
||||
ImGui::Text("%s", node->Name);
|
||||
ImGui::SliderFloat("##value", &node->Value, 0.0f, 1.0f, "Alpha %.2f");
|
||||
float dummy_color[3] = { node->Pos.x / ImGui::GetWindowWidth(), node->Pos.y / ImGui::GetWindowHeight(), fmodf((float)node->ID * 0.5f, 1.0f) };
|
||||
ImGui::ColorEdit3("##color", &dummy_color[0]);
|
||||
ImGui::EndGroup();
|
||||
|
||||
// Save the size of what we have emitted and weither any of the widgets are being used
|
||||
bool node_widgets_active = (!old_any_active && ImGui::IsAnyItemActive());
|
||||
node->Size = ImGui::GetItemRectSize() + NODE_WINDOW_PADDING + NODE_WINDOW_PADDING;
|
||||
ImVec2 node_rect_max = node_rect_min + node->Size;
|
||||
|
||||
// Display node box
|
||||
draw_list->ChannelsSetCurrent(0); // Background
|
||||
ImGui::SetCursorScreenPos(node_rect_min);
|
||||
ImGui::InvisibleButton("node", node->Size);
|
||||
if (ImGui::IsItemHovered())
|
||||
{
|
||||
node_hovered_in_scene = node->ID;
|
||||
open_context_menu |= ImGui::IsMouseClicked(1);
|
||||
}
|
||||
bool node_moving_active = ImGui::IsItemActive();
|
||||
if (node_widgets_active || node_moving_active)
|
||||
node_selected = node->ID;
|
||||
if (node_moving_active && ImGui::IsMouseDragging(0))
|
||||
node->Pos = node->Pos + ImGui::GetIO().MouseDelta;
|
||||
|
||||
ImU32 node_bg_color = (node_hovered_in_list == node->ID || node_hovered_in_scene == node->ID || (node_hovered_in_list == -1 && node_selected == node->ID)) ? ImColor(75,75,75) : ImColor(60,60,60);
|
||||
draw_list->AddRectFilled(node_rect_min, node_rect_max, node_bg_color, 4.0f);
|
||||
draw_list->AddRect(node_rect_min, node_rect_max, ImColor(100,100,100), 4.0f);
|
||||
for (int slot_idx = 0; slot_idx < node->InputsCount; slot_idx++)
|
||||
draw_list->AddCircleFilled(offset + node->GetInputSlotPos(slot_idx), NODE_SLOT_RADIUS, ImColor(150,150,150,150));
|
||||
for (int slot_idx = 0; slot_idx < node->OutputsCount; slot_idx++)
|
||||
draw_list->AddCircleFilled(offset + node->GetOutputSlotPos(slot_idx), NODE_SLOT_RADIUS, ImColor(150,150,150,150));
|
||||
|
||||
ImGui::PopID();
|
||||
}
|
||||
draw_list->ChannelsMerge();
|
||||
|
||||
// Open context menu
|
||||
if (!ImGui::IsAnyItemHovered() && ImGui::IsMouseHoveringWindow() && ImGui::IsMouseClicked(1))
|
||||
{
|
||||
node_selected = node_hovered_in_list = node_hovered_in_scene = -1;
|
||||
open_context_menu = true;
|
||||
}
|
||||
if (open_context_menu)
|
||||
{
|
||||
ImGui::OpenPopup("context_menu");
|
||||
if (node_hovered_in_list != -1)
|
||||
node_selected = node_hovered_in_list;
|
||||
if (node_hovered_in_scene != -1)
|
||||
node_selected = node_hovered_in_scene;
|
||||
}
|
||||
|
||||
// Draw context menu
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(8,8));
|
||||
if (ImGui::BeginPopup("context_menu"))
|
||||
{
|
||||
Node* node = node_selected != -1 ? &nodes[node_selected] : NULL;
|
||||
ImVec2 scene_pos = ImGui::GetMousePosOnOpeningCurrentPopup() - offset;
|
||||
if (node)
|
||||
{
|
||||
ImGui::Text("Node '%s'", node->Name);
|
||||
ImGui::Separator();
|
||||
if (ImGui::MenuItem("Rename..", NULL, false, false)) {}
|
||||
if (ImGui::MenuItem("Delete", NULL, false, false)) {}
|
||||
if (ImGui::MenuItem("Copy", NULL, false, false)) {}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ImGui::MenuItem("Add")) { nodes.push_back(Node(nodes.Size, "New node", scene_pos, 0.5f, 2, 2)); }
|
||||
if (ImGui::MenuItem("Paste", NULL, false, false)) {}
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
ImGui::PopStyleVar();
|
||||
|
||||
// Scrolling
|
||||
if (ImGui::IsWindowHovered() && !ImGui::IsAnyItemActive() && ImGui::IsMouseDragging(2, 0.0f))
|
||||
scrolling = scrolling - ImGui::GetIO().MouseDelta;
|
||||
|
||||
ImGui::PopItemWidth();
|
||||
ImGui::EndChild();
|
||||
ImGui::PopStyleColor();
|
||||
ImGui::PopStyleVar(2);
|
||||
ImGui::EndGroup();
|
||||
|
||||
ImGui::End();
|
||||
}
|
|
@ -12,7 +12,7 @@ namespace ImGui
|
|||
// Setup
|
||||
ImVec2 picker_pos = ImGui::GetCursorScreenPos();
|
||||
ImVec2 sv_picker_size = ImVec2(256.0f, 256.0f); // Saturation/Value picking box
|
||||
float bars_width = ImGui::GetWindowFontSize() + style.FramePadding.y*2.0f; // Width of Hue/Alpha picking bars (using Framepadding.y to match the ColorButton sides)
|
||||
float bars_width = ImGui::GetFontSize() + style.FramePadding.y*2.0f; // Width of Hue/Alpha picking bars (using Framepadding.y to match the ColorButton sides)
|
||||
float bar0_pos_x = picker_pos.x + sv_picker_size.x + style.ItemInnerSpacing.x;
|
||||
float bar1_pos_x = bar0_pos_x + bars_width + style.ItemInnerSpacing.x;
|
||||
|
||||
|
|
|
@ -512,8 +512,6 @@ namespace ImGui
|
|||
|
||||
Begin("##Overlay",
|
||||
NULL,
|
||||
ImVec2(0, 0),
|
||||
0.f,
|
||||
ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove |
|
||||
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings |
|
||||
ImGuiWindowFlags_AlwaysAutoResize);
|
||||
|
@ -968,8 +966,6 @@ namespace ImGui
|
|||
SetNextWindowSize(dock.size);
|
||||
bool ret = Begin(label,
|
||||
opened,
|
||||
dock.size,
|
||||
-1.0f,
|
||||
ImGuiWindowFlags_NoCollapse | extra_flags);
|
||||
m_end_action = EndAction_End;
|
||||
dock.pos = GetWindowPos();
|
||||
|
|
|
@ -202,7 +202,7 @@ namespace ImGui
|
|||
|
||||
Separator();
|
||||
|
||||
AlignFirstTextHeightToWidgets();
|
||||
AlignTextToFramePadding();
|
||||
PushItemWidth(50);
|
||||
PushAllowKeyboardFocus(false);
|
||||
int rows_backup = Rows;
|
||||
|
|
|
@ -339,12 +339,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 5.0f, m_height / 2.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_width / 5.0f, m_height / 2.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
ImGui::SliderFloat("Speed", &m_speed, 0.0f, 1.0f);
|
||||
|
|
|
@ -142,12 +142,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 5.0f, m_height / 2.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_width / 5.0f, m_height / 2.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
bool recomputeVisibleText = false;
|
||||
|
|
|
@ -144,12 +144,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 5.0f, m_height / 2.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_width / 5.0f, m_height / 6.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
ImGui::Checkbox("Transition", &m_transitions);
|
||||
|
|
|
@ -926,12 +926,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_viewState.m_width - m_viewState.m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_viewState.m_width / 5.0f, m_viewState.m_height / 2.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_viewState.m_width / 5.0f, m_viewState.m_height / 2.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
{
|
||||
|
|
|
@ -2164,11 +2164,17 @@ public:
|
|||
|
||||
showExampleDialog(this);
|
||||
|
||||
ImGui::SetNextWindowPos(ImVec2(m_viewState.m_width - 256.0f, 10.0f) );
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_viewState.m_width - 256.0f, 10.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(256.0f, 700.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(256.0f, 700.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
const char* titles[2] =
|
||||
|
@ -2266,11 +2272,17 @@ public:
|
|||
|
||||
ImGui::End();
|
||||
|
||||
ImGui::SetNextWindowPos(ImVec2(10, float(m_viewState.m_height) - 77.0f - 10.0f) );
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(10, float(m_viewState.m_height) - 77.0f - 10.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(120.0f, 77.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Show help:"
|
||||
, NULL
|
||||
, ImVec2(120.0f, 77.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
if (ImGui::Button(m_showHelp ? "ON" : "OFF") )
|
||||
|
|
|
@ -1984,12 +1984,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_viewState.m_width - m_viewState.m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_viewState.m_width / 5.0f, m_viewState.m_height - 20.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_viewState.m_width / 5.0f, m_viewState.m_height - 20.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
#define IMGUI_FLOAT_SLIDER(_name, _val) \
|
||||
|
@ -2086,12 +2089,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(10.0f, 260.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_viewState.m_width / 5.0f, 350.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Light"
|
||||
, NULL
|
||||
, ImVec2(m_viewState.m_width / 5.0f, 350.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
ImGui::PushItemWidth(185.0f);
|
||||
|
||||
|
|
|
@ -333,12 +333,17 @@ public:
|
|||
|
||||
showExampleDialog(this);
|
||||
|
||||
ImGui::SetNextWindowPos(ImVec2((float)m_width - (float)m_width / 4.0f - 10.0f, 10.0f) );
|
||||
ImGui::SetNextWindowSize(ImVec2((float)m_width / 4.0f, (float)m_height / 2.0f) );
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2((float)m_width - (float)m_width / 4.0f - 10.0f, 10.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2((float)m_width / 4.0f, (float)m_height / 2.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2((float)m_width / 4.0f, (float)m_height / 2.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
ImGui::RadioButton("Rotate",&m_transform,0);
|
||||
|
|
|
@ -592,12 +592,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 5.0f, m_height - 20.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_width / 5.0f, m_height - 20.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
ImGui::PushItemWidth(180.0f);
|
||||
|
||||
|
@ -707,12 +710,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(10.0f, 260.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 5.0f, 450.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Mesh"
|
||||
, NULL
|
||||
, ImVec2(m_width / 5.0f, 450.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
ImGui::Text("Mesh:");
|
||||
|
|
|
@ -307,12 +307,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 5.0f, m_height / 3.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_width / 5.0f, m_height / 3.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
ImGui::Separator();
|
||||
|
|
|
@ -436,12 +436,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 5.0f, m_height / 3.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_width / 5.0f, m_height / 3.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
ImGui::SliderInt("Num lights", &m_numLights, 1, 2048);
|
||||
|
|
|
@ -280,12 +280,15 @@ public:
|
|||
{
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 5.0f, m_height / 1.5f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_width / 5.0f, m_height / 1.5f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
bool reset = false;
|
||||
|
|
|
@ -406,12 +406,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 5.0f, m_height / 3.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_width / 5.0f, m_height / 3.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
ImGui::Separator();
|
||||
|
|
|
@ -385,12 +385,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 5.0f, m_height * 0.75f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_width / 5.0f, m_height * 0.75f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
ImGui::Separator();
|
||||
|
|
|
@ -209,12 +209,15 @@ public:
|
|||
{
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 5.0f, m_height / 2.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_width / 5.0f, m_height / 2.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
ImGui::Image(m_pickingRT, ImVec2(m_width / 5.0f - 16.0f, m_width / 5.0f - 16.0f) );
|
||||
|
|
|
@ -593,12 +593,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 5.0f, m_height / 3.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_width / 5.0f, m_height / 3.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
ImGui::SliderFloat("RSM Amount", &m_rsmAmount, 0.0f, 0.7f);
|
||||
|
|
|
@ -372,12 +372,14 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 4.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 4.0f, m_height - 20.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_width / 4.0f, m_height - 20.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
);
|
||||
|
||||
static float timeScale = 1.0f;
|
||||
|
|
|
@ -265,12 +265,15 @@ public:
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(m_width / 5.0f, m_height / 2.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin("Settings"
|
||||
, NULL
|
||||
, ImVec2(m_width / 5.0f, m_height / 2.0f)
|
||||
, ImGuiWindowFlags_AlwaysAutoResize
|
||||
, 0
|
||||
);
|
||||
|
||||
ImGui::RadioButton("No bump mapping", &m_shading_type, 0);
|
||||
|
|
|
@ -561,7 +561,7 @@ namespace
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
|
||||
imgui(m_width / 5.0f - 10.0f);
|
||||
|
|
|
@ -49,13 +49,15 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
|
|||
|
||||
ImGui::SetNextWindowPos(
|
||||
ImVec2(10.0f, 50.0f)
|
||||
, ImGuiSetCond_FirstUseEver
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
ImGui::Begin(temp
|
||||
, NULL
|
||||
, ImVec2(256.0f, 200.0f)
|
||||
ImGui::SetNextWindowSize(
|
||||
ImVec2(256.0f, 200.0f)
|
||||
, ImGuiCond_FirstUseEver
|
||||
);
|
||||
|
||||
ImGui::Begin(temp);
|
||||
|
||||
ImGui::TextWrapped("%s", _app->getDescription() );
|
||||
ImGui::Separator();
|
||||
|
||||
|
|
Loading…
Reference in New Issue