|
|
@ -1,4 +1,4 @@
|
|
|
|
// ImGui library v1.36 WIP
|
|
|
|
// ImGui library v1.37 WIP
|
|
|
|
// See .cpp file for documentation.
|
|
|
|
// See .cpp file for documentation.
|
|
|
|
// See ImGui::ShowTestWindow() for sample code.
|
|
|
|
// See ImGui::ShowTestWindow() for sample code.
|
|
|
|
// Read 'Programmer guide' in .cpp for notes on how to setup ImGui in your codebase.
|
|
|
|
// Read 'Programmer guide' in .cpp for notes on how to setup ImGui in your codebase.
|
|
|
@ -13,7 +13,7 @@
|
|
|
|
#include <stdlib.h> // NULL, malloc
|
|
|
|
#include <stdlib.h> // NULL, malloc
|
|
|
|
#include <string.h> // memset, memmove
|
|
|
|
#include <string.h> // memset, memmove
|
|
|
|
|
|
|
|
|
|
|
|
#define IMGUI_VERSION "1.36 WIP"
|
|
|
|
#define IMGUI_VERSION "1.37 WIP"
|
|
|
|
|
|
|
|
|
|
|
|
// Define assertion handler.
|
|
|
|
// Define assertion handler.
|
|
|
|
#ifndef IM_ASSERT
|
|
|
|
#ifndef IM_ASSERT
|
|
|
@ -223,8 +223,10 @@ namespace ImGui
|
|
|
|
IMGUI_API void EndTooltip();
|
|
|
|
IMGUI_API void EndTooltip();
|
|
|
|
|
|
|
|
|
|
|
|
// Layout
|
|
|
|
// Layout
|
|
|
|
|
|
|
|
IMGUI_API void BeginGroup();
|
|
|
|
|
|
|
|
IMGUI_API void EndGroup();
|
|
|
|
IMGUI_API void Separator(); // horizontal line
|
|
|
|
IMGUI_API void Separator(); // horizontal line
|
|
|
|
IMGUI_API void SameLine(int column_x = 0, int spacing_w = -1); // call between widgets to layout them horizontally
|
|
|
|
IMGUI_API void SameLine(int column_x = 0, int spacing_w = -1); // call between widgets or groups to layout them horizontally
|
|
|
|
IMGUI_API void Spacing(); // add vertical spacing
|
|
|
|
IMGUI_API void Spacing(); // add vertical spacing
|
|
|
|
IMGUI_API void Indent(); // move content position toward the right by style.IndentSpacing pixels
|
|
|
|
IMGUI_API void Indent(); // move content position toward the right by style.IndentSpacing pixels
|
|
|
|
IMGUI_API void Unindent(); // move content position back to the left (cancel Indent)
|
|
|
|
IMGUI_API void Unindent(); // move content position back to the left (cancel Indent)
|
|
|
@ -286,6 +288,7 @@ namespace ImGui
|
|
|
|
IMGUI_API bool SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* display_format = "%.0f");
|
|
|
|
IMGUI_API bool SliderInt3(const char* label, int v[3], int v_min, int v_max, const char* display_format = "%.0f");
|
|
|
|
IMGUI_API bool SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* display_format = "%.0f");
|
|
|
|
IMGUI_API bool SliderInt4(const char* label, int v[4], int v_min, int v_max, const char* display_format = "%.0f");
|
|
|
|
IMGUI_API bool VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
|
|
|
|
IMGUI_API bool VSliderFloat(const char* label, const ImVec2& size, float* v, float v_min, float v_max, const char* display_format = "%.3f", float power = 1.0f);
|
|
|
|
|
|
|
|
IMGUI_API bool VSliderInt(const char* label, const ImVec2& size, int* v, int v_min, int v_max, const char* display_format = "%.0f");
|
|
|
|
IMGUI_API void PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
|
|
|
|
IMGUI_API void PlotLines(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
|
|
|
|
IMGUI_API void PlotLines(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0));
|
|
|
|
IMGUI_API void PlotLines(const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0));
|
|
|
|
IMGUI_API void PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
|
|
|
|
IMGUI_API void PlotHistogram(const char* label, const float* values, int values_count, int values_offset = 0, const char* overlay_text = NULL, float scale_min = FLT_MAX, float scale_max = FLT_MAX, ImVec2 graph_size = ImVec2(0,0), size_t stride = sizeof(float));
|
|
|
@ -349,25 +352,29 @@ namespace ImGui
|
|
|
|
|
|
|
|
|
|
|
|
// Utilities
|
|
|
|
// Utilities
|
|
|
|
IMGUI_API bool IsItemHovered(); // was the last item hovered by mouse?
|
|
|
|
IMGUI_API bool IsItemHovered(); // was the last item hovered by mouse?
|
|
|
|
|
|
|
|
IMGUI_API bool IsItemHoveredRectOnly(); // was the last item hovered by mouse? even if another item is active while we are hovering this.
|
|
|
|
IMGUI_API bool IsItemActive(); // was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
|
|
|
|
IMGUI_API bool IsItemActive(); // was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
|
|
|
|
IMGUI_API bool IsAnyItemActive(); //
|
|
|
|
IMGUI_API bool IsAnyItemActive(); //
|
|
|
|
|
|
|
|
IMGUI_API ImVec2 GetItemActiveDragDelta(); // mouse delta from the time the item first got active
|
|
|
|
|
|
|
|
IMGUI_API ImVec2 GetItemRectMin(); // get bounding rect of last item
|
|
|
|
|
|
|
|
IMGUI_API ImVec2 GetItemRectMax(); // "
|
|
|
|
|
|
|
|
IMGUI_API ImVec2 GetItemRectSize(); // "
|
|
|
|
IMGUI_API bool IsWindowFocused(); // is current window focused (differentiate child windows from each others)
|
|
|
|
IMGUI_API bool IsWindowFocused(); // is current window focused (differentiate child windows from each others)
|
|
|
|
IMGUI_API bool IsRootWindowFocused(); // is current root window focused
|
|
|
|
IMGUI_API bool IsRootWindowFocused(); // is current root window focused
|
|
|
|
IMGUI_API bool IsRootWindowOrAnyChildFocused(); // is current root window or any of its child (including current window) focused
|
|
|
|
IMGUI_API bool IsRootWindowOrAnyChildFocused(); // is current root window or any of its child (including current window) focused
|
|
|
|
IMGUI_API ImVec2 GetItemBoxMin(); // get bounding box of last item
|
|
|
|
|
|
|
|
IMGUI_API ImVec2 GetItemBoxMax(); // get bounding box of last item
|
|
|
|
|
|
|
|
IMGUI_API bool IsClipped(const ImVec2& item_size); // to perform coarse clipping on user's side (as an optimization)
|
|
|
|
IMGUI_API bool IsClipped(const ImVec2& item_size); // to perform coarse clipping on user's side (as an optimization)
|
|
|
|
IMGUI_API bool IsKeyPressed(int key_index, bool repeat = true); // key_index into the keys_down[512] array, imgui doesn't know the semantic of each entry
|
|
|
|
IMGUI_API bool IsKeyPressed(int key_index, bool repeat = true); // key_index into the keys_down[512] array, imgui doesn't know the semantic of each entry
|
|
|
|
IMGUI_API bool IsMouseClicked(int button, bool repeat = false);
|
|
|
|
IMGUI_API bool IsMouseClicked(int button, bool repeat = false);
|
|
|
|
IMGUI_API bool IsMouseDoubleClicked(int button);
|
|
|
|
IMGUI_API bool IsMouseDoubleClicked(int button);
|
|
|
|
IMGUI_API bool IsMouseHoveringWindow(); // is mouse hovering current window ("window" in API names always refer to current window)
|
|
|
|
IMGUI_API bool IsMouseHoveringWindow(); // is mouse hovering current window ("window" in API names always refer to current window)
|
|
|
|
IMGUI_API bool IsMouseHoveringAnyWindow(); // is mouse hovering any active imgui window
|
|
|
|
IMGUI_API bool IsMouseHoveringAnyWindow(); // is mouse hovering any active imgui window
|
|
|
|
IMGUI_API bool IsMouseHoveringBox(const ImVec2& box_min, const ImVec2& box_max); // is mouse hovering given bounding box
|
|
|
|
IMGUI_API bool IsMouseHoveringRect(const ImVec2& rect_min, const ImVec2& rect_max);// is mouse hovering given bounding rect
|
|
|
|
IMGUI_API bool IsPosHoveringAnyWindow(const ImVec2& pos); // is given position hovering any active imgui window
|
|
|
|
IMGUI_API bool IsPosHoveringAnyWindow(const ImVec2& pos); // is given position hovering any active imgui window
|
|
|
|
IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
|
|
|
|
IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
|
|
|
|
IMGUI_API float GetTime();
|
|
|
|
IMGUI_API float GetTime();
|
|
|
|
IMGUI_API int GetFrameCount();
|
|
|
|
IMGUI_API int GetFrameCount();
|
|
|
|
IMGUI_API const char* GetStyleColName(ImGuiCol idx);
|
|
|
|
IMGUI_API const char* GetStyleColName(ImGuiCol idx);
|
|
|
|
|
|
|
|
IMGUI_API ImVec2 CalcItemRectClosestPoint(const ImVec2& pos, bool on_edge = false, float outward = +0.0f); // utility to find the closest point the last item bounding rectangle edge. useful to visually link items.
|
|
|
|
IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);
|
|
|
|
IMGUI_API ImVec2 CalcTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f);
|
|
|
|
IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // helper to manually clip large list of items. see comments in implementation.
|
|
|
|
IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // helper to manually clip large list of items. see comments in implementation.
|
|
|
|
|
|
|
|
|
|
|
@ -385,9 +392,12 @@ namespace ImGui
|
|
|
|
IMGUI_API void SetInternalState(void* state, bool construct = false);
|
|
|
|
IMGUI_API void SetInternalState(void* state, bool construct = false);
|
|
|
|
|
|
|
|
|
|
|
|
// Obsolete (will be removed)
|
|
|
|
// Obsolete (will be removed)
|
|
|
|
IMGUI_API void GetDefaultFontData(const void** fnt_data, unsigned int* fnt_size, const void** png_data, unsigned int* png_size);
|
|
|
|
IMGUI_API void GetDefaultFontData(const void** fnt_data, unsigned int* fnt_size, const void** png_data, unsigned int* png_size); // OBSOLETE
|
|
|
|
static inline void OpenNextNode(bool open) { ImGui::SetNextTreeNodeOpened(open, 0); }
|
|
|
|
static inline void OpenNextNode(bool open) { ImGui::SetNextTreeNodeOpened(open, 0); } // OBSOLETE
|
|
|
|
static inline bool GetWindowIsFocused() { return ImGui::IsWindowFocused(); }
|
|
|
|
static inline bool GetWindowIsFocused() { return ImGui::IsWindowFocused(); } // OBSOLETE
|
|
|
|
|
|
|
|
static inline ImVec2 GetItemBoxMin() { return GetItemRectMin(); } // OBSOLETE
|
|
|
|
|
|
|
|
static inline ImVec2 GetItemBoxMax() { return GetItemRectMax(); } // OBSOLETE
|
|
|
|
|
|
|
|
static inline bool IsMouseHoveringBox(const ImVec2& rect_min, const ImVec2& rect_max) { return IsMouseHoveringRect(rect_min, rect_max); } // OBSOLETE
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace ImGui
|
|
|
|
} // namespace ImGui
|
|
|
|
|
|
|
|
|
|
|
@ -542,13 +552,14 @@ struct ImGuiStyle
|
|
|
|
float FrameRounding; // Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
|
|
|
|
float FrameRounding; // Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
|
|
|
|
ImVec2 ItemSpacing; // Horizontal and vertical spacing between widgets/lines
|
|
|
|
ImVec2 ItemSpacing; // Horizontal and vertical spacing between widgets/lines
|
|
|
|
ImVec2 ItemInnerSpacing; // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
|
|
|
|
ImVec2 ItemInnerSpacing; // Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
|
|
|
|
ImVec2 TouchExtraPadding; // Expand bounding box for touch-based system where touch position is not accurate enough (unnecessary for mouse inputs). Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget running. So dont grow this too much!
|
|
|
|
ImVec2 TouchExtraPadding; // Expand reactive bounding box for touch-based system where touch position is not accurate enough. Unfortunately we don't sort widgets so priority on overlap will always be given to the first widget. So don't grow this too much!
|
|
|
|
ImVec2 AutoFitPadding; // Extra space after auto-fit (double-clicking on resize grip)
|
|
|
|
ImVec2 AutoFitPadding; // Extra space after auto-fit (double-clicking on resize grip)
|
|
|
|
float WindowFillAlphaDefault; // Default alpha of window background, if not specified in ImGui::Begin()
|
|
|
|
float WindowFillAlphaDefault; // Default alpha of window background, if not specified in ImGui::Begin()
|
|
|
|
float IndentSpacing; // Horizontal indentation when e.g. entering a tree node
|
|
|
|
float IndentSpacing; // Horizontal indentation when e.g. entering a tree node
|
|
|
|
float ColumnsMinSpacing; // Minimum horizontal spacing between two columns
|
|
|
|
float ColumnsMinSpacing; // Minimum horizontal spacing between two columns
|
|
|
|
float ScrollbarWidth; // Width of the vertical scrollbar
|
|
|
|
float ScrollbarWidth; // Width of the vertical scrollbar
|
|
|
|
float GrabMinSize; // Minimum width/height of a slider or scrollbar grab
|
|
|
|
float GrabMinSize; // Minimum width/height of a slider or scrollbar grab
|
|
|
|
|
|
|
|
ImVec2 DisplaySafeAreaPadding; // Window positions are clamped to be visible within the display area. If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding.
|
|
|
|
ImVec4 Colors[ImGuiCol_COUNT];
|
|
|
|
ImVec4 Colors[ImGuiCol_COUNT];
|
|
|
|
|
|
|
|
|
|
|
|
IMGUI_API ImGuiStyle();
|
|
|
|
IMGUI_API ImGuiStyle();
|
|
|
@ -853,6 +864,7 @@ struct ImDrawList
|
|
|
|
ImDrawList() { Clear(); }
|
|
|
|
ImDrawList() { Clear(); }
|
|
|
|
IMGUI_API void Clear();
|
|
|
|
IMGUI_API void Clear();
|
|
|
|
IMGUI_API void PushClipRect(const ImVec4& clip_rect); // Scissoring. The values are x1, y1, x2, y2.
|
|
|
|
IMGUI_API void PushClipRect(const ImVec4& clip_rect); // Scissoring. The values are x1, y1, x2, y2.
|
|
|
|
|
|
|
|
IMGUI_API void PushClipRectFullScreen();
|
|
|
|
IMGUI_API void PopClipRect();
|
|
|
|
IMGUI_API void PopClipRect();
|
|
|
|
IMGUI_API void PushTextureID(const ImTextureID& texture_id);
|
|
|
|
IMGUI_API void PushTextureID(const ImTextureID& texture_id);
|
|
|
|
IMGUI_API void PopTextureID();
|
|
|
|
IMGUI_API void PopTextureID();
|
|
|
@ -867,13 +879,13 @@ struct ImDrawList
|
|
|
|
IMGUI_API void Stroke(ImU32 col, bool closed = false);
|
|
|
|
IMGUI_API void Stroke(ImU32 col, bool closed = false);
|
|
|
|
|
|
|
|
|
|
|
|
// Primitives
|
|
|
|
// Primitives
|
|
|
|
IMGUI_API void AddLine(const ImVec2& a, const ImVec2& b, ImU32 col);
|
|
|
|
IMGUI_API void AddLine(const ImVec2& a, const ImVec2& b, ImU32 col, float half_thickness = 0.50f);
|
|
|
|
IMGUI_API void AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
|
|
|
|
IMGUI_API void AddRect(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
|
|
|
|
IMGUI_API void AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
|
|
|
|
IMGUI_API void AddRectFilled(const ImVec2& a, const ImVec2& b, ImU32 col, float rounding = 0.0f, int rounding_corners=0x0F);
|
|
|
|
IMGUI_API void AddTriangleFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col);
|
|
|
|
IMGUI_API void AddTriangleFilled(const ImVec2& a, const ImVec2& b, const ImVec2& c, ImU32 col);
|
|
|
|
IMGUI_API void AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
|
|
|
|
IMGUI_API void AddCircle(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
|
|
|
|
IMGUI_API void AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
|
|
|
|
IMGUI_API void AddCircleFilled(const ImVec2& centre, float radius, ImU32 col, int num_segments = 12);
|
|
|
|
IMGUI_API void AddText(ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec2* cpu_clip_max = NULL);
|
|
|
|
IMGUI_API void AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec2* cpu_clip_max = NULL);
|
|
|
|
IMGUI_API void AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv0, const ImVec2& uv1, ImU32 col = 0xFFFFFFFF);
|
|
|
|
IMGUI_API void AddImage(ImTextureID user_texture_id, const ImVec2& a, const ImVec2& b, const ImVec2& uv0, const ImVec2& uv1, ImU32 col = 0xFFFFFFFF);
|
|
|
|
IMGUI_API void AddPolyline(const ImVec2* points, const int num_points, ImU32 col, bool closed);
|
|
|
|
IMGUI_API void AddPolyline(const ImVec2* points, const int num_points, ImU32 col, bool closed);
|
|
|
|
IMGUI_API void AddConvexPolyFilled(const ImVec2* points, const int num_points, ImU32 col);
|
|
|
|
IMGUI_API void AddConvexPolyFilled(const ImVec2* points, const int num_points, ImU32 col);
|
|
|
@ -886,7 +898,6 @@ struct ImDrawList
|
|
|
|
IMGUI_API void ReserveVertices(unsigned int vtx_count);
|
|
|
|
IMGUI_API void ReserveVertices(unsigned int vtx_count);
|
|
|
|
IMGUI_API void AddVtx(const ImVec2& pos, ImU32 col);
|
|
|
|
IMGUI_API void AddVtx(const ImVec2& pos, ImU32 col);
|
|
|
|
IMGUI_API void AddVtxUV(const ImVec2& pos, ImU32 col, const ImVec2& uv);
|
|
|
|
IMGUI_API void AddVtxUV(const ImVec2& pos, ImU32 col, const ImVec2& uv);
|
|
|
|
IMGUI_API void AddVtxLine(const ImVec2& a, const ImVec2& b, ImU32 col);
|
|
|
|
|
|
|
|
IMGUI_API void UpdateClipRect();
|
|
|
|
IMGUI_API void UpdateClipRect();
|
|
|
|
IMGUI_API void UpdateTextureID();
|
|
|
|
IMGUI_API void UpdateTextureID();
|
|
|
|
};
|
|
|
|
};
|
|
|
|