Updated ImGui.
This commit is contained in:
Родитель
ad5b63522c
Коммит
afe33307da
|
@ -5,6 +5,7 @@
|
|||
// Newcomers, read 'Programmer guide' below for notes on how to setup ImGui in your codebase.
|
||||
// Get latest version at https://github.com/ocornut/imgui
|
||||
// Releases change-log at https://github.com/ocornut/imgui/releases
|
||||
// Gallery (please post your screenshots/video there!): https://github.com/ocornut/imgui/issues/772
|
||||
// Developed by Omar Cornut and every direct or indirect contributors to the GitHub.
|
||||
// This library is free but I need your support to sustain development and maintenance.
|
||||
// If you work for a company, please consider financial support, e.g: https://www.patreon.com/imgui
|
||||
|
@ -280,7 +281,6 @@
|
|||
Check the "API BREAKING CHANGES" sections for a list of occasional API breaking changes. If you have a problem with a function, search for its name
|
||||
in the code, there will likely be a comment about it. Please report any issue to the GitHub page!
|
||||
|
||||
|
||||
Q: What is ImTextureID and how do I display an image?
|
||||
A: ImTextureID is a void* used to pass renderer-agnostic texture references around until it hits your render function.
|
||||
ImGui knows nothing about what those bits represent, it just passes them around. It is up to you to decide what you want the void* to carry!
|
||||
|
@ -464,7 +464,7 @@
|
|||
ISSUES & TODO-LIST
|
||||
==================
|
||||
Issue numbers (#) refer to github issues listed at https://github.com/ocornut/imgui/issues
|
||||
The list below consist mostly of notes of things to do before they are requested/discussed by users (at that point it usually happens on the github)
|
||||
The list below consist mostly of ideas noted down before they are requested/discussed by users (at which point it usually moves to the github)
|
||||
|
||||
- doc: add a proper documentation+regression testing system (#435)
|
||||
- window: add a way for very transient windows (non-saved, temporary overlay over hundreds of objects) to "clean" up from the global window list. perhaps a lightweight explicit cleanup pass.
|
||||
|
@ -8405,7 +8405,7 @@ bool ImGui::InputInt4(const char* label, int v[4], ImGuiInputTextFlags extra_fla
|
|||
|
||||
static bool Items_ArrayGetter(void* data, int idx, const char** out_text)
|
||||
{
|
||||
const char** items = (const char**)data;
|
||||
const char* const* items = (const char* const*)data;
|
||||
if (out_text)
|
||||
*out_text = items[idx];
|
||||
return true;
|
||||
|
@ -8432,7 +8432,7 @@ static bool Items_SingleStringGetter(void* data, int idx, const char** out_text)
|
|||
}
|
||||
|
||||
// Combo box helper allowing to pass an array of strings.
|
||||
bool ImGui::Combo(const char* label, int* current_item, const char** items, int items_count, int height_in_items)
|
||||
bool ImGui::Combo(const char* label, int* current_item, const char* const* items, int items_count, int height_in_items)
|
||||
{
|
||||
const bool value_changed = Combo(label, current_item, Items_ArrayGetter, (void*)items, items_count, height_in_items);
|
||||
return value_changed;
|
||||
|
@ -8709,7 +8709,7 @@ void ImGui::ListBoxFooter()
|
|||
EndGroup();
|
||||
}
|
||||
|
||||
bool ImGui::ListBox(const char* label, int* current_item, const char** items, int items_count, int height_items)
|
||||
bool ImGui::ListBox(const char* label, int* current_item, const char* const* items, int items_count, int height_items)
|
||||
{
|
||||
const bool value_changed = ListBox(label, current_item, Items_ArrayGetter, (void*)items, items_count, height_items);
|
||||
return value_changed;
|
||||
|
|
|
@ -265,7 +265,7 @@ namespace ImGui
|
|||
IMGUI_API bool CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value);
|
||||
IMGUI_API bool RadioButton(const char* label, bool active);
|
||||
IMGUI_API bool RadioButton(const char* label, int* v, int v_button);
|
||||
IMGUI_API bool Combo(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
|
||||
IMGUI_API bool Combo(const char* label, int* current_item, const char* const* items, int items_count, int height_in_items = -1);
|
||||
IMGUI_API bool Combo(const char* label, int* current_item, const char* items_separated_by_zeros, int height_in_items = -1); // separate items with \0, end item-list with \0\0
|
||||
IMGUI_API bool Combo(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1);
|
||||
IMGUI_API bool ColorButton(const ImVec4& col, bool small_height = false, bool outline_border = true);
|
||||
|
@ -339,7 +339,7 @@ namespace ImGui
|
|||
// Widgets: Selectable / Lists
|
||||
IMGUI_API bool Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0)); // size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height
|
||||
IMGUI_API bool Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0,0));
|
||||
IMGUI_API bool ListBox(const char* label, int* current_item, const char** items, int items_count, int height_in_items = -1);
|
||||
IMGUI_API bool ListBox(const char* label, int* current_item, const char* const* items, int items_count, int height_in_items = -1);
|
||||
IMGUI_API bool ListBox(const char* label, int* current_item, bool (*items_getter)(void* data, int idx, const char** out_text), void* data, int items_count, int height_in_items = -1);
|
||||
IMGUI_API bool ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0,0)); // use if you want to reimplement ListBox() will custom data or interactions. make sure to call ListBoxFooter() afterwards.
|
||||
IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // "
|
||||
|
|
|
@ -1123,7 +1123,8 @@ void ImGui::ShowTestWindow(bool* p_open)
|
|||
ImGui::BeginChild("scrolling", ImVec2(0, ImGui::GetItemsLineHeightWithSpacing()*7 + 30), true, ImGuiWindowFlags_HorizontalScrollbar);
|
||||
for (int line = 0; line < lines; line++)
|
||||
{
|
||||
// Display random stuff
|
||||
// Display random stuff (for the sake of this trivial demo we are using basic Button+SameLine. If you want to create your own time line for a real application you may be better off
|
||||
// manipulating the cursor position yourself, aka using SetCursorPos/SetCursorScreenPos to position the widgets yourself. You may also want to use the lower-level ImDrawList API)
|
||||
int num_buttons = 10 + ((line & 1) ? line * 9 : line * 3);
|
||||
for (int n = 0; n < num_buttons; n++)
|
||||
{
|
||||
|
@ -1181,6 +1182,8 @@ void ImGui::ShowTestWindow(bool* p_open)
|
|||
const char* names[] = { "Bream", "Haddock", "Mackerel", "Pollock", "Tilefish" };
|
||||
static bool toggles[] = { true, false, false, false, false };
|
||||
|
||||
// Simple selection popup
|
||||
// (If you want to show the current selection inside the Button itself, you may want to build a string using the "###" operator to preserve a constant ID with a variable label)
|
||||
if (ImGui::Button("Select.."))
|
||||
ImGui::OpenPopup("select");
|
||||
ImGui::SameLine();
|
||||
|
@ -1195,6 +1198,7 @@ void ImGui::ShowTestWindow(bool* p_open)
|
|||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
// Showing a menu with toggles
|
||||
if (ImGui::Button("Toggle.."))
|
||||
ImGui::OpenPopup("toggle");
|
||||
if (ImGui::BeginPopup("toggle"))
|
||||
|
@ -1229,8 +1233,8 @@ void ImGui::ShowTestWindow(bool* p_open)
|
|||
}
|
||||
|
||||
if (ImGui::Button("Popup Menu.."))
|
||||
ImGui::OpenPopup("popup from button");
|
||||
if (ImGui::BeginPopup("popup from button"))
|
||||
ImGui::OpenPopup("FilePopup");
|
||||
if (ImGui::BeginPopup("FilePopup"))
|
||||
{
|
||||
ShowExampleMenuFile();
|
||||
ImGui::EndPopup();
|
||||
|
|
Загрузка…
Ссылка в новой задаче