mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
Merge branch 'master' into docking
# Conflicts: # examples/imgui_impl_opengl3.cpp # imgui.cpp # imgui_draw.cpp # imgui_internal.h
This commit is contained in:
44
imgui.h
44
imgui.h
@ -151,7 +151,7 @@ typedef int ImGuiBackendFlags; // -> enum ImGuiBackendFlags_ // Flags: f
|
||||
typedef int ImGuiColorEditFlags; // -> enum ImGuiColorEditFlags_ // Flags: for ColorEdit4(), ColorPicker4() etc.
|
||||
typedef int ImGuiConfigFlags; // -> enum ImGuiConfigFlags_ // Flags: for io.ConfigFlags
|
||||
typedef int ImGuiComboFlags; // -> enum ImGuiComboFlags_ // Flags: for BeginCombo()
|
||||
typedef int ImGuiDockNodeFlags; // -> enum ImGuiDockNodeFlags_ // Flags: for DockSpace()
|
||||
typedef int ImGuiDockNodeFlags; // -> enum ImGuiDockNodeFlags_ // Flags: for DockSpace()
|
||||
typedef int ImGuiDragDropFlags; // -> enum ImGuiDragDropFlags_ // Flags: for BeginDragDropSource(), AcceptDragDropPayload()
|
||||
typedef int ImGuiFocusedFlags; // -> enum ImGuiFocusedFlags_ // Flags: for IsWindowFocused()
|
||||
typedef int ImGuiHoveredFlags; // -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc.
|
||||
@ -340,7 +340,7 @@ namespace ImGui
|
||||
IMGUI_API ImU32 GetColorU32(ImU32 col); // retrieve given color with style alpha applied
|
||||
|
||||
// Parameters stacks (current window)
|
||||
IMGUI_API void PushItemWidth(float item_width); // set width of items for common large "item+label" widgets. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -1.0f always align width to the right side). 0.0f = default to ~2/3 of windows width,
|
||||
IMGUI_API void PushItemWidth(float item_width); // set width of items for common large "item+label" widgets. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -1.0f always align width to the right side). 0.0f = default to ~2/3 of windows width,
|
||||
IMGUI_API void PopItemWidth();
|
||||
IMGUI_API void SetNextItemWidth(float item_width); // set width of the _next_ common large "item+label" widget. >0.0f: width in pixels, <0.0f align xx pixels to the right of window (so -1.0f always align width to the right side)
|
||||
IMGUI_API float CalcItemWidth(); // width of item given pushed settings and current cursor position. NOT necessarily the width of last item unlike most 'Item' functions.
|
||||
@ -602,9 +602,9 @@ namespace ImGui
|
||||
IMGUI_API void EndTabItem(); // only call EndTabItem() if BeginTabItem() returns true!
|
||||
IMGUI_API void SetTabItemClosed(const char* tab_or_docked_window_label); // notify TabBar or Docking system of a closed tab/window ahead (useful to reduce visual flicker on reorderable tab bars). For tab-bar: call after BeginTabBar() and before Tab submissions. Otherwise call with a window name.
|
||||
|
||||
// Docking
|
||||
// Docking
|
||||
// [BETA API] Enable with io.ConfigFlags |= ImGuiConfigFlags_DockingEnable.
|
||||
// Note: you DO NOT need to call DockSpace() to use most Docking facilities!
|
||||
// Note: you DO NOT need to call DockSpace() to use most Docking facilities!
|
||||
// - To dock windows: if io.ConfigDockingWithShift == false (default) drag window from their title bar.
|
||||
// - To dock windows: if io.ConfigDockingWithShift == true: hold SHIFT anywhere while moving windows.
|
||||
// - Use DockSpace() to create an explicit dock node _within_ an existing window. See Docking demo for details.
|
||||
@ -613,7 +613,7 @@ namespace ImGui
|
||||
IMGUI_API void SetNextWindowDockID(ImGuiID dock_id, ImGuiCond cond = 0); // set next window dock id (FIXME-DOCK)
|
||||
IMGUI_API void SetNextWindowClass(const ImGuiWindowClass* window_class); // set next window class (rare/advanced uses: provide hints to the platform back-end via altered viewport flags and parent/child info)
|
||||
IMGUI_API ImGuiID GetWindowDockID();
|
||||
IMGUI_API bool IsWindowDocked(); // is current window docked into another window?
|
||||
IMGUI_API bool IsWindowDocked(); // is current window docked into another window?
|
||||
|
||||
// Logging/Capture
|
||||
// - All text output from the interface can be captured into tty/file/clipboard. By default, tree nodes are automatically opened during logging.
|
||||
@ -932,7 +932,7 @@ enum ImGuiDockNodeFlags_
|
||||
ImGuiDockNodeFlags_NoDockingInCentralNode = 1 << 2, // Shared // Disable docking inside the Central Node, which will be always kept empty.
|
||||
ImGuiDockNodeFlags_PassthruCentralNode = 1 << 3, // Shared // Enable passthru dockspace: 1) DockSpace() will render a ImGuiCol_WindowBg background covering everything excepted the Central Node when empty. Meaning the host window should probably use SetNextWindowBgAlpha(0.0f) prior to Begin() when using this. 2) When Central Node is empty: let inputs pass-through + won't display a DockingEmptyBg background. See demo for details.
|
||||
ImGuiDockNodeFlags_NoSplit = 1 << 4, // Shared/Local // Disable splitting the node into smaller nodes. Useful e.g. when embedding dockspaces into a main root one (the root one may have splitting disabled to reduce confusion). Note: when turned off, existing splits will be preserved.
|
||||
ImGuiDockNodeFlags_NoResize = 1 << 5, // Shared/Local // Disable resizing node using the splitter/separators. Useful with programatically setup dockspaces.
|
||||
ImGuiDockNodeFlags_NoResize = 1 << 5, // Shared/Local // Disable resizing node using the splitter/separators. Useful with programatically setup dockspaces.
|
||||
ImGuiDockNodeFlags_AutoHideTabBar = 1 << 6 // Shared/Local // Tab bar will automatically hide when there is a single window in the dock node.
|
||||
};
|
||||
|
||||
@ -1361,7 +1361,7 @@ struct ImGuiStyle
|
||||
float WindowBorderSize; // Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
|
||||
ImVec2 WindowMinSize; // Minimum window size. This is a global setting. If you want to constraint individual windows, use SetNextWindowSizeConstraints().
|
||||
ImVec2 WindowTitleAlign; // Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.
|
||||
ImGuiDir WindowMenuButtonPosition; // Side of the collapsing/docking button in the title bar (left/right). Defaults to ImGuiDir_Left.
|
||||
ImGuiDir WindowMenuButtonPosition; // Side of the collapsing/docking button in the title bar (None/Left/Right). Defaults to ImGuiDir_Left.
|
||||
float ChildRounding; // Radius of child window corners rounding. Set to 0.0f to have rectangular windows.
|
||||
float ChildBorderSize; // Thickness of border around child windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
|
||||
float PopupRounding; // Radius of popup window corners rounding. (Note that tooltip windows use WindowRounding)
|
||||
@ -1433,7 +1433,7 @@ struct ImGuiIO
|
||||
bool ConfigDockingWithShift; // = false // Enable docking with holding Shift key (reduce visual noise, allows dropping in wider space)
|
||||
bool ConfigDockingAlwaysTabBar; // = false // [BETA] [FIXME: This currently creates regression with auto-sizing and general overhead] Make every single floating window display within a docking node.
|
||||
bool ConfigDockingTransparentPayload;// = false // [BETA] Make window or viewport transparent when docking and only display docking boxes on the target viewport. Useful if rendering of multiple viewport cannot be synced. Best used with ConfigViewportsNoAutoMerge.
|
||||
|
||||
|
||||
// Viewport options (when ImGuiConfigFlags_ViewportsEnable is set)
|
||||
bool ConfigViewportsNoAutoMerge; // = false; // Set to make all floating imgui windows always create their own viewport. Otherwise, they are merged into the main host viewports when overlapping it. May also set ImGuiViewportFlags_NoAutoMerge on individual viewport.
|
||||
bool ConfigViewportsNoTaskBarIcon; // = false // Disable default OS task bar icon flag for secondary viewports. When a viewport doesn't want a task bar icon, ImGuiViewportFlags_NoTaskBarIcon will be set on it.
|
||||
@ -1858,7 +1858,7 @@ struct ImColor
|
||||
|
||||
// Draw callbacks for advanced uses.
|
||||
// NB: You most likely do NOT need to use draw callbacks just to create your own widget or customized UI rendering,
|
||||
// you can poke into the draw list for that! Draw callback may be useful for example to:
|
||||
// you can poke into the draw list for that! Draw callback may be useful for example to:
|
||||
// A) Change your GPU render state,
|
||||
// B) render a complex 3D scene inside a UI element without an intermediate texture/render target, etc.
|
||||
// The expected behavior from your rendering function is 'if (cmd.UserCallback != NULL) { cmd.UserCallback(parent_list, cmd); } else { RenderTriangles() }'
|
||||
@ -1889,7 +1889,7 @@ struct ImDrawCmd
|
||||
ImDrawCmd() { ElemCount = 0; TextureId = (ImTextureID)NULL; VtxOffset = IdxOffset = 0; UserCallback = NULL; UserCallbackData = NULL; }
|
||||
};
|
||||
|
||||
// Vertex index
|
||||
// Vertex index
|
||||
// (to allow large meshes with 16-bits indices: set 'io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset' and handle ImDrawCmd::VtxOffset in the renderer back-end)
|
||||
// (to use 32-bits indices: override with '#define ImDrawIdx unsigned int' in imconfig.h)
|
||||
#ifndef ImDrawIdx
|
||||
@ -1920,7 +1920,7 @@ struct ImDrawChannel
|
||||
};
|
||||
|
||||
// Split/Merge functions are used to split the draw list into different layers which can be drawn into out of order.
|
||||
// This is used by the Columns api, so items of each column can be batched together in a same draw call.
|
||||
// This is used by the Columns api, so items of each column can be batched together in a same draw call.
|
||||
struct ImDrawListSplitter
|
||||
{
|
||||
int _Current; // Current channel number (0)
|
||||
@ -1961,7 +1961,7 @@ enum ImDrawListFlags_
|
||||
// Draw command list
|
||||
// This is the low-level list of polygons that ImGui:: functions are filling. At the end of the frame,
|
||||
// all command lists are passed to your ImGuiIO::RenderDrawListFn function for rendering.
|
||||
// Each dear imgui window contains its own ImDrawList. You can use ImGui::GetWindowDrawList() to
|
||||
// Each dear imgui window contains its own ImDrawList. You can use ImGui::GetWindowDrawList() to
|
||||
// access the current window draw list and draw custom primitives.
|
||||
// You can interleave normal ImGui:: calls and adding primitives to the current draw list.
|
||||
// All positions are generally in pixel coordinates (generally top-left at 0,0, bottom-right at io.DisplaySize, unless multiple viewports are used), but you are totally free to apply whatever transformation matrix to want to the data (if you apply such transformation you'll want to apply it to ClipRect as well)
|
||||
@ -2106,6 +2106,7 @@ struct ImFontConfig
|
||||
bool MergeMode; // false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs). You may want to use GlyphOffset.y when merge font of different heights.
|
||||
unsigned int RasterizerFlags; // 0x00 // Settings for custom font rasterizer (e.g. ImGuiFreeType). Leave as zero if you aren't using one.
|
||||
float RasterizerMultiply; // 1.0f // Brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable.
|
||||
ImWchar EllipsisChar; // -1 // Explicitly specify unicode codepoint of ellipsis character. When fonts are being merged first specified ellipsis will be used.
|
||||
|
||||
// [Internal]
|
||||
char Name[40]; // Name (strictly to ease debugging)
|
||||
@ -2221,9 +2222,9 @@ struct ImFontAtlas
|
||||
// [BETA] Custom Rectangles/Glyphs API
|
||||
//-------------------------------------------
|
||||
|
||||
// You can request arbitrary rectangles to be packed into the atlas, for your own purposes.
|
||||
// You can request arbitrary rectangles to be packed into the atlas, for your own purposes.
|
||||
// After calling Build(), you can query the rectangle position and render your pixels.
|
||||
// You can also request your rectangles to be mapped as font glyph (given a font + Unicode point),
|
||||
// You can also request your rectangles to be mapped as font glyph (given a font + Unicode point),
|
||||
// so you can render e.g. custom colorful icons and use them as regular glyphs.
|
||||
// Read misc/fonts/README.txt for more details about using colorful icons.
|
||||
IMGUI_API int AddCustomRectRegular(unsigned int id, int width, int height); // Id needs to be >= 0x10000. Id >= 0x80000000 are reserved for ImGui and ImDrawList
|
||||
@ -2282,7 +2283,8 @@ struct ImFont
|
||||
ImFontAtlas* ContainerAtlas; // 4-8 // out // // What we has been loaded into
|
||||
const ImFontConfig* ConfigData; // 4-8 // in // // Pointer within ContainerAtlas->ConfigData
|
||||
short ConfigDataCount; // 2 // in // ~ 1 // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont.
|
||||
ImWchar FallbackChar; // 2 // in // = '?' // Replacement glyph if one isn't found. Only set via SetFallbackChar()
|
||||
ImWchar FallbackChar; // 2 // in // = '?' // Replacement character if a glyph isn't found. Only set via SetFallbackChar()
|
||||
ImWchar EllipsisChar; // 2 // out // = -1 // Character used for ellipsis rendering.
|
||||
float Scale; // 4 // in // = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetWindowFontScale()
|
||||
float Ascent, Descent; // 4+4 // out // // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
|
||||
int MetricsTotalSurface;// 4 // out // // Total surface in pixels to get an idea of the font rasterization/texture cost (not exact, we approximate the cost of padding between glyphs)
|
||||
@ -2325,7 +2327,7 @@ struct ImFont
|
||||
// - if you are new to dear imgui and trying to integrate it into your engine, you should probably ignore this for now.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// (Optional) This is required when enabling multi-viewport. Represent the bounds of each connected monitor/display and their DPI.
|
||||
// (Optional) This is required when enabling multi-viewport. Represent the bounds of each connected monitor/display and their DPI.
|
||||
// We use this information for multiple DPI support + clamping the position of popups and tooltips so they don't straddle multiple monitors.
|
||||
struct ImGuiPlatformMonitor
|
||||
{
|
||||
@ -2335,12 +2337,12 @@ struct ImGuiPlatformMonitor
|
||||
ImGuiPlatformMonitor() { MainPos = MainSize = WorkPos = WorkSize = ImVec2(0,0); DpiScale = 1.0f; }
|
||||
};
|
||||
|
||||
// (Optional) Setup required only if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable) is enabled.
|
||||
// (Optional) Setup required only if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable) is enabled.
|
||||
// Access via ImGui::GetPlatformIO(). This is designed so we can mix and match two imgui_impl_xxxx files,
|
||||
// one for the Platform (~window handling), one for Renderer. Custom engine back-ends will often provide
|
||||
// one for the Platform (~window handling), one for Renderer. Custom engine back-ends will often provide
|
||||
// both Platform and Renderer interfaces and so may not need to use all functions.
|
||||
// Platform functions are typically called before their Renderer counterpart,
|
||||
// apart from Destroy which are called the other way.
|
||||
// Platform functions are typically called before their Renderer counterpart,
|
||||
// apart from Destroy which are called the other way.
|
||||
// RenderPlatformWindowsDefault() is that helper that iterate secondary viewports and call, in this order:
|
||||
// Platform_RenderWindow(), Renderer_RenderWindow(), Platform_SwapBuffers(), Renderer_SwapBuffers()
|
||||
// You may skip using RenderPlatformWindowsDefault() and call your draw/swap functions yourself if you need
|
||||
@ -2389,7 +2391,7 @@ struct ImGuiPlatformIO
|
||||
|
||||
// List of viewports (the list is updated by calling ImGui::EndFrame or ImGui::Render)
|
||||
ImGuiViewport* MainViewport; // Guaranteed to be == Viewports[0]
|
||||
ImVector<ImGuiViewport*> Viewports; // Main viewports, followed by all secondary viewports.
|
||||
ImVector<ImGuiViewport*> Viewports; // Main viewports, followed by all secondary viewports.
|
||||
ImGuiPlatformIO() { memset(this, 0, sizeof(*this)); } // Zero clear
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user