The main release package of Ashita v3. Contains all the needed files for users to get up and running. Used by the launcher/injector to auto-update as well.https://ashitaxi.com/
You can not select more than 25 topicsTopics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
structImDrawChannel;// Temporary storage for outputting drawing commands out of order, used by ImDrawList::ChannelsSplit()
structImDrawCmd;// A single draw command within a parent ImDrawList (generally maps to 1 GPU draw call)
structImDrawData;// All draw command lists required to render the frame
structImDrawList;// A single draw command list (generally one per window)
structImDrawVert;// A single vertex (20 bytes by default, override layout with IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT)
structImFont;// Runtime data for a single font within a parent ImFontAtlas
structImFontAtlas;// Runtime data for multiple fonts, bake multiple fonts into a single texture, TTF font loader
structImFontConfig;// Configuration data when adding a font or merging fonts
structImColor;// Helper functions to create a color that can be converted to either u32 or float4
structImGuiIO;// Main configuration and I/O between your application and ImGui
structImGuiOnceUponAFrame;// Simple helper for running a block of code not more than once a frame, used by IMGUI_ONCE_UPON_A_FRAME macro
structImGuiStorage;// Simple custom key value storage
structImGuiStyle;// Runtime data for styling/colors
structImGuiTextFilter;// Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
structImGuiTextBuffer;// Text buffer for logging/accumulating text
structImGuiTextEditCallbackData;// Shared state of ImGui::InputText() when using custom ImGuiTextEditCallback (rare/advanced use)
structImGuiSizeConstraintCallbackData;// Structure used to constraint window size in custom ways when using custom ImGuiSizeConstraintCallback (rare/advanced use)
structImGuiListClipper;// Helper to manually clip large list of items
structImGuiContext;// ImGui context (opaque)
// Enumerations (declared as int for compatibility and to not pollute the top of this file)
typedefunsignedintImU32;
typedefunsignedshortImWchar;// character for keyboard input/display
typedefvoid*ImTextureID;// user data to identify a texture (this is whatever to you want it to be! read the FAQ about ImTextureID in imgui.cpp)
typedefImU32ImGuiID;// unique ID used by widgets (typically hashed from a stack of string)
typedefintImGuiCol;// a color identifier for styling // enum ImGuiCol_
typedefintImGuiStyleVar;// a variable identifier for styling // enum ImGuiStyleVar_
typedefintImGuiKey;// a key identifier (ImGui-side enum) // enum ImGuiKey_
ImGuiWindowFlags_NoResize=1<<1,// Disable user resizing with the lower-right grip
ImGuiWindowFlags_NoMove=1<<2,// Disable user moving the window
ImGuiWindowFlags_NoScrollbar=1<<3,// Disable scrollbars (window can still scroll with mouse or programatically)
ImGuiWindowFlags_NoScrollWithMouse=1<<4,// Disable user vertically scrolling with mouse wheel
ImGuiWindowFlags_NoCollapse=1<<5,// Disable user collapsing window by double-clicking on it
ImGuiWindowFlags_AlwaysAutoResize=1<<6,// Resize every window to its content every frame
ImGuiWindowFlags_ShowBorders=1<<7,// Show borders around windows and items
ImGuiWindowFlags_NoSavedSettings=1<<8,// Never load/save settings in .ini file
ImGuiWindowFlags_NoInputs=1<<9,// Disable catching mouse or keyboard inputs
ImGuiWindowFlags_MenuBar=1<<10,// Has a menu-bar
ImGuiWindowFlags_HorizontalScrollbar=1<<11,// Allow horizontal scrollbar to appear (off by default). You may use SetNextWindowContentSize(ImVec2(width,0.0f)); prior to calling Begin() to specify width. Read code in imgui_demo in the "Horizontal Scrolling" section.
ImGuiWindowFlags_NoFocusOnAppearing=1<<12,// Disable taking focus when transitioning from hidden to visible state
ImGuiWindowFlags_NoBringToFrontOnFocus=1<<13,// Disable bringing window to front when taking focus (e.g. clicking on it or programatically giving it focus)
ImGuiWindowFlags_AlwaysVerticalScrollbar=1<<14,// Always show vertical scrollbar (even if ContentSize.y < Size.y)
ImGuiWindowFlags_AlwaysHorizontalScrollbar=1<<15,// Always show horizontal scrollbar (even if ContentSize.x < Size.x)
ImGuiWindowFlags_AlwaysUseWindowPadding=1<<16,// Ensure child windows without border uses style.WindowPadding (ignored by default for non-bordered child windows, because more convenient)
// [Internal]
ImGuiWindowFlags_ChildWindow=1<<20,// Don't use! For internal use by BeginChild()
ImGuiWindowFlags_ChildWindowAutoFitX=1<<21,// Don't use! For internal use by BeginChild()
ImGuiWindowFlags_ChildWindowAutoFitY=1<<22,// Don't use! For internal use by BeginChild()
ImGuiWindowFlags_ComboBox=1<<23,// Don't use! For internal use by ComboBox()
ImGuiWindowFlags_Tooltip=1<<24,// Don't use! For internal use by BeginTooltip()
ImGuiWindowFlags_Popup=1<<25,// Don't use! For internal use by BeginPopup()
ImGuiWindowFlags_Modal=1<<26,// Don't use! For internal use by BeginPopupModal()
ImGuiWindowFlags_ChildMenu=1<<27// Don't use! For internal use by BeginMenu()
ImGuiInputTextFlags_CharsUppercase=1<<2,// Turn a..z into A..Z
ImGuiInputTextFlags_CharsNoBlank=1<<3,// Filter out spaces, tabs
ImGuiInputTextFlags_AutoSelectAll=1<<4,// Select entire text when first taking mouse focus
ImGuiInputTextFlags_EnterReturnsTrue=1<<5,// Return 'true' when Enter is pressed (as opposed to when the value was modified)
ImGuiInputTextFlags_CallbackCompletion=1<<6,// Call user function on pressing TAB (for completion handling)
ImGuiInputTextFlags_CallbackHistory=1<<7,// Call user function on pressing Up/Down arrows (for history handling)
ImGuiInputTextFlags_CallbackAlways=1<<8,// Call user function every time. User code may query cursor position, modify text buffer.
ImGuiInputTextFlags_CallbackCharFilter=1<<9,// Call user function to filter character. Modify data->EventChar to replace/filter input, or return 1 to discard character.
ImGuiInputTextFlags_AllowTabInput=1<<10,// Pressing TAB input a '\t' character into the text field
ImGuiInputTextFlags_CtrlEnterForNewLine=1<<11,// In multi-line mode, allow exiting edition by pressing Enter. Ctrl+Enter to add new line (by default adds new lines with Enter).
ImGuiInputTextFlags_NoHorizontalScroll=1<<12,// Disable following the cursor horizontally
ImGuiInputTextFlags_Password=1<<15,// Password mode, display all characters as '*'
// [Internal]
ImGuiInputTextFlags_Multiline=1<<20// For internal use by InputTextMultiline()
};
// Flags for ImGui::TreeNodeEx(), ImGui::CollapsingHeader*()
enumImGuiTreeNodeFlags_
{
ImGuiTreeNodeFlags_Selected=1<<0,// Draw as selected
ImGuiTreeNodeFlags_Framed=1<<1,// Full colored frame (e.g. for CollapsingHeader)
ImGuiTreeNodeFlags_AllowOverlapMode=1<<2,// Hit testing to allow subsequent widgets to overlap this one
ImGuiTreeNodeFlags_NoTreePushOnOpen=1<<3,// Don't do a TreePush() when open (e.g. for CollapsingHeader) = no extra indent nor pushing on ID stack
ImGuiTreeNodeFlags_NoAutoOpenOnLog=1<<4,// Don't automatically and temporarily open node when Logging is active (by default logging will automatically open tree nodes)
ImGuiTreeNodeFlags_DefaultOpen=1<<5,// Default node to be open
ImGuiTreeNodeFlags_OpenOnDoubleClick=1<<6,// Need double-click to open node
ImGuiTreeNodeFlags_OpenOnArrow=1<<7,// Only open when clicking on the arrow part. If ImGuiTreeNodeFlags_OpenOnDoubleClick is also set, single-click arrow or double-click all box to open.
ImGuiTreeNodeFlags_Leaf=1<<8,// No collapsing, no arrow (use as a convenience for leaf nodes).
ImGuiTreeNodeFlags_Bullet=1<<9,// Display a bullet instead of arrow
ImGuiSelectableFlags_DontClosePopups=1<<0,// Clicking this don't close parent popup window
ImGuiSelectableFlags_SpanAllColumns=1<<1,// Selectable frame can span all columns (text will still fit in current column)
ImGuiSelectableFlags_AllowDoubleClick=1<<2// Generate press events on double clicks too
};
// User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array
enumImGuiKey_
{
ImGuiKey_Tab,// for tabbing through fields
ImGuiKey_LeftArrow,// for text edit
ImGuiKey_RightArrow,// for text edit
ImGuiKey_UpArrow,// for text edit
ImGuiKey_DownArrow,// for text edit
ImGuiKey_PageUp,
ImGuiKey_PageDown,
ImGuiKey_Home,// for text edit
ImGuiKey_End,// for text edit
ImGuiKey_Delete,// for text edit
ImGuiKey_Backspace,// for text edit
ImGuiKey_Enter,// for text edit
ImGuiKey_Escape,// for text edit
ImGuiKey_A,// for text edit CTRL+A: select all
ImGuiKey_C,// for text edit CTRL+C: copy
ImGuiKey_V,// for text edit CTRL+V: paste
ImGuiKey_X,// for text edit CTRL+X: cut
ImGuiKey_Y,// for text edit CTRL+Y: redo
ImGuiKey_Z,// for text edit CTRL+Z: undo
ImGuiKey_COUNT
};
// Enumeration for PushStyleColor() / PopStyleColor()
enumImGuiCol_
{
ImGuiCol_Text,
ImGuiCol_TextDisabled,
ImGuiCol_WindowBg,// Background of normal windows
ImGuiCol_ChildWindowBg,// Background of child windows
ImGuiCol_PopupBg,// Background of popups, menus, tooltips windows
ImGuiCol_Border,
ImGuiCol_BorderShadow,
ImGuiCol_FrameBg,// Background of checkbox, radio button, plot, slider, text input
ImGuiCol_FrameBgHovered,
ImGuiCol_FrameBgActive,
ImGuiCol_TitleBg,
ImGuiCol_TitleBgCollapsed,
ImGuiCol_TitleBgActive,
ImGuiCol_MenuBarBg,
ImGuiCol_ScrollbarBg,
ImGuiCol_ScrollbarGrab,
ImGuiCol_ScrollbarGrabHovered,
ImGuiCol_ScrollbarGrabActive,
ImGuiCol_ComboBg,
ImGuiCol_CheckMark,
ImGuiCol_SliderGrab,
ImGuiCol_SliderGrabActive,
ImGuiCol_Button,
ImGuiCol_ButtonHovered,
ImGuiCol_ButtonActive,
ImGuiCol_Header,
ImGuiCol_HeaderHovered,
ImGuiCol_HeaderActive,
ImGuiCol_Column,
ImGuiCol_ColumnHovered,
ImGuiCol_ColumnActive,
ImGuiCol_ResizeGrip,
ImGuiCol_ResizeGripHovered,
ImGuiCol_ResizeGripActive,
ImGuiCol_CloseButton,
ImGuiCol_CloseButtonHovered,
ImGuiCol_CloseButtonActive,
ImGuiCol_PlotLines,
ImGuiCol_PlotLinesHovered,
ImGuiCol_PlotHistogram,
ImGuiCol_PlotHistogramHovered,
ImGuiCol_TextSelectedBg,
ImGuiCol_ModalWindowDarkening,// darken entire screen when a modal window is active
ImGuiCol_COUNT
};
// Enumeration for PushStyleVar() / PopStyleVar()
// NB: the enum only refers to fields of ImGuiStyle() which makes sense to be pushed/poped in UI code. Feel free to add others.
enumImGuiStyleVar_
{
ImGuiStyleVar_Alpha,// float
ImGuiStyleVar_WindowPadding,// ImVec2
ImGuiStyleVar_WindowRounding,// float
ImGuiStyleVar_WindowMinSize,// ImVec2
ImGuiStyleVar_ChildWindowRounding,// float
ImGuiStyleVar_FramePadding,// ImVec2
ImGuiStyleVar_FrameRounding,// float
ImGuiStyleVar_ItemSpacing,// ImVec2
ImGuiStyleVar_ItemInnerSpacing,// ImVec2
ImGuiStyleVar_IndentSpacing,// float
ImGuiStyleVar_GrabMinSize// float
};
enumImGuiAlign_
{
ImGuiAlign_Left=1<<0,
ImGuiAlign_Center=1<<1,
ImGuiAlign_Right=1<<2,
ImGuiAlign_Top=1<<3,
ImGuiAlign_VCenter=1<<4,
ImGuiAlign_Default=ImGuiAlign_Left|ImGuiAlign_Top
};
// Enumeration for ColorEditMode()
enumImGuiColorEditMode_
{
ImGuiColorEditMode_UserSelect=-2,
ImGuiColorEditMode_UserSelectShowButton=-1,
ImGuiColorEditMode_RGB=0,
ImGuiColorEditMode_HSV=1,
ImGuiColorEditMode_HEX=2
};
// Enumeration for GetMouseCursor()
enumImGuiMouseCursor_
{
ImGuiMouseCursor_Arrow=0,
ImGuiMouseCursor_TextInput,// When hovering over InputText, etc.
ImGuiMouseCursor_Move,// Unused
ImGuiMouseCursor_ResizeNS,// Unused
ImGuiMouseCursor_ResizeEW,// When hovering over a column
ImGuiMouseCursor_ResizeNESW,// Unused
ImGuiMouseCursor_ResizeNWSE,// When hovering over the bottom-right corner of a window
ImGuiMouseCursor_Count_
};
// Condition flags for ImGui::SetWindow***(), SetNextWindow***(), SetNextTreeNode***() functions
// All those functions treat 0 as a shortcut to ImGuiSetCond_Always
enumImGuiSetCond_
{
ImGuiSetCond_Always=1<<0,// Set the variable
ImGuiSetCond_Once=1<<1,// Only set the variable on the first call per runtime session
ImGuiSetCond_FirstUseEver=1<<2,// Only set the variable if the window doesn't exist in the .ini file
ImGuiSetCond_Appearing=1<<3// Only set the variable if the window is appearing after being inactive (or the first time)
};
structImGuiStyle
{
floatAlpha;// Global alpha applies to everything in ImGui
ImVec2WindowPadding;// Padding within a window
ImVec2WindowMinSize;// Minimum window size
floatWindowRounding;// Radius of window corners rounding. Set to 0.0f to have rectangular windows
ImGuiAlignWindowTitleAlign;// Alignment for title bar text
floatChildWindowRounding;// Radius of child window corners rounding. Set to 0.0f to have rectangular windows
ImVec2FramePadding;// Padding within a framed rectangle (used by most widgets)
floatFrameRounding;// Radius of frame corners rounding. Set to 0.0f to have rectangular frame (used by most widgets).
ImVec2ItemSpacing;// Horizontal and vertical spacing between widgets/lines
ImVec2ItemInnerSpacing;// Horizontal and vertical spacing between within elements of a composed widget (e.g. a slider and its label)
ImVec2TouchExtraPadding;// 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!
floatIndentSpacing;// Horizontal indentation when e.g. entering a tree node. Generally == (FontSize + FramePadding.x*2).
floatColumnsMinSpacing;// Minimum horizontal spacing between two columns
floatScrollbarSize;// Width of the vertical scrollbar, Height of the horizontal scrollbar
floatScrollbarRounding;// Radius of grab corners for scrollbar
floatGrabMinSize;// Minimum width/height of a grab box for slider/scrollbar
floatGrabRounding;// Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
ImVec2DisplayWindowPadding;// Window positions are clamped to be visible within the display area by at least this amount. Only covers regular windows.
ImVec2DisplaySafeAreaPadding;// If you cannot see the edge of your screen (e.g. on a TV) increase the safe area padding. Covers popups/tooltips as well regular windows.
boolAntiAliasedLines;// Enable anti-aliasing on lines/borders. Disable if you are really tight on CPU/GPU.
boolAntiAliasedShapes;// Enable anti-aliasing on filled shapes (rounded rectangles, circles, etc.)
floatCurveTessellationTol;// Tessellation tolerance. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
ImVec4Colors[ImGuiCol_COUNT];
IMGUI_APIImGuiStyle();
};
// This is where your app communicate with ImGui. Access via ImGui::GetIO().
// Read 'Programmer guide' section in .cpp file for general usage.
ImVec2DisplaySize;// <unset> // Display size, in pixels. For clamping windows positions.
floatDeltaTime;// = 1.0f/60.0f // Time elapsed since last frame, in seconds.
floatIniSavingRate;// = 5.0f // Maximum time between saving positions/sizes to .ini file, in seconds.
constchar*IniFilename;// = "imgui.ini" // Path to .ini file. NULL to disable .ini saving.
constchar*LogFilename;// = "imgui_log.txt" // Path to .log file (default parameter to ImGui::LogToFile when no file is specified).
floatMouseDoubleClickTime;// = 0.30f // Time for a double-click, in seconds.
floatMouseDoubleClickMaxDist;// = 6.0f // Distance threshold to stay in to validate a double-click, in pixels.
floatMouseDragThreshold;// = 6.0f // Distance threshold before considering we are dragging
intKeyMap[ImGuiKey_COUNT];// <unset> // Map of indices into the KeysDown[512] entries array
floatKeyRepeatDelay;// = 0.250f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
floatKeyRepeatRate;// = 0.020f // When holding a key/button, rate at which it repeats, in seconds.
void*UserData;// = NULL // Store your own data for retrieval by callbacks.
ImFontAtlas*Fonts;// <auto> // Load and assemble one or more fonts into a single tightly packed texture. Output to Fonts array.
floatFontGlobalScale;// = 1.0f // Global scale all fonts
boolFontAllowUserScaling;// = false // Allow user scaling text of individual window with CTRL+Wheel.
ImVec2DisplayFramebufferScale;// = (1.0f,1.0f) // For retina display or other situations where window coordinates are different from framebuffer coordinates. User storage only, presently not used by ImGui.
ImVec2DisplayVisibleMin;// <unset> (0.0f,0.0f) // If you use DisplaySize as a virtual space larger than your screen, set DisplayVisibleMin/Max to the visible area.
ImVec2DisplayVisibleMax;// <unset> (0.0f,0.0f) // If the values are the same, we defaults to Min=(0.0f) and Max=DisplaySize
// Advanced/subtle behaviors
boolWordMovementUsesAltKey;// = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl
boolShortcutsUseSuperKey;// = defined(__APPLE__) // OS X style: Shortcuts using Cmd/Super instead of Ctrl
boolDoubleClickSelectsWord;// = defined(__APPLE__) // OS X style: Double click selects by word instead of selecting whole text
boolMultiSelectUsesSuperKey;// = defined(__APPLE__) // OS X style: Multi-selection in lists uses Cmd/Super instead of Ctrl [unused yet]
// Rendering function, will be called in Render().
// Alternatively you can keep this to NULL and call GetDrawData() after Render() to get the same pointer.
// See example applications if you are unsure of how to implement this.
void(*RenderDrawListsFn)(ImDrawData*data);
// Optional: access OS clipboard
// (default to use native Win32 clipboard on Windows, otherwise uses a private clipboard. Override to access OS clipboard on other architectures)
constchar*(*GetClipboardTextFn)();
void(*SetClipboardTextFn)(constchar*text);
// Optional: override memory allocations. MemFreeFn() may be called with a NULL pointer.
// (default to posix malloc/free)
void*(*MemAllocFn)(size_tsz);
void(*MemFreeFn)(void*ptr);
// Optional: notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME in Windows)
// (default to use native imm32 api on Windows)
void(*ImeSetInputScreenPosFn)(intx,inty);
void*ImeWindowHandle;// (Windows) Set this to your HWND to get automatic IME cursor positioning.
ImVec2MousePos;// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
boolMouseDown[5];// Mouse buttons: left, right, middle + extras. ImGui itself mostly only uses left button (BeginPopupContext** are using right button). Others buttons allows us to track if the mouse is being used by your application + available to user as a convenience via IsMouse** API.
floatMouseWheel;// Mouse wheel: 1 unit scrolls about 5 lines text.
boolMouseDrawCursor;// Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor).
ImVec2MouseDelta;// Mouse delta. Note that this is zero if either current or previous position are negative to allow mouse enabling/disabling.
boolMouseClicked[5];// Mouse button went from !Down to Down
ImVec2MouseClickedPos[5];// Position at time of clicking
floatMouseClickedTime[5];// Time of last click (used to figure out double-click)
boolMouseDoubleClicked[5];// Has mouse button been double-clicked?
boolMouseReleased[5];// Mouse button went from Down to !Down
boolMouseDownOwned[5];// Track if button was clicked inside a window. We don't request mouse capture from the application if click started outside ImGui bounds.
floatMouseDownDuration[5];// Duration the mouse button has been down (0.0f == just clicked)
floatMouseDownDurationPrev[5];// Previous time the mouse button has been down
floatMouseDragMaxDistanceSqr[5];// Squared maximum distance of how much mouse has traveled from the click point
floatKeysDownDuration[512];// Duration the keyboard key has been down (0.0f == just pressed)
floatKeysDownDurationPrev[512];// Previous duration the key has been down
// Lightweight std::vector<> like class to avoid dragging dependencies (also: windows implementation of STL with debug enabled is absurdly slow, so let's bypass it so our code runs fast in debug).
// Our implementation does NOT call c++ constructors because we don't use them in ImGui. Don't use this class as a straight std::vector replacement in your code!
IMGUI_APIvoid*GetVoidPtr(ImGuiIDkey)const;// default_val is NULL
IMGUI_APIvoidSetVoidPtr(ImGuiIDkey,void*val);
// - Get***Ref() functions finds pair, insert on demand if missing, return pointer. Useful if you intend to do Get+Set.
// - References are only valid until a new value is added to the storage. Calling a Set***() function or a Get***Ref() function invalidates the pointer.
// If you are submitting lots of evenly spaced items and you have a random access to the list, you can perform coarse clipping based on visibility to save yourself from processing those items at all.
// The clipper calculates the range of visible items and advance the cursor to compensate for the non-visible items we have skipped.
// ImGui already clip items based on their bounds but it needs to measure text size to do so. Coarse clipping before submission makes this cost and your own data fetching/submission cost null.
// Usage:
// ImGuiListClipper clipper(1000); // we have 1000 elements, evenly spaced.
// while (clipper.Step())
// for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
// ImGui::Text("line number %d", i);
// - Step 0: the clipper let you process the first element, regardless of it being visible or not, so we can measure the element height (step skipped if we passed a known height as second arg to constructor).
// - Step 1: the clipper infer height from first element, calculate the actual range of elements to display, and position the cursor before the first element.
// - (Step 2: dummy step only required if an explicit items_height was passed to constructor or Begin() and user call Step(). Does nothing and switch to Step 3.)
// - Step 3: the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd), advance the cursor to the end of the list and then returns 'false' to end the loop.
structImGuiListClipper
{
floatStartPosY;
floatItemsHeight;
intItemsCount,StepNo,DisplayStart,DisplayEnd;
// items_count: Use -1 to ignore (you can call Begin later). Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step).
// items_height: Use -1.0f to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetItemsLineHeightWithSpacing().
// If you don't specify an items_height, you NEED to call Step(). If you specify items_height you may call the old Begin()/End() api directly, but prefer calling Step().
ImGuiListClipper(intitems_count=-1,floatitems_height=-1.0f){Begin(items_count,items_height);}// NB: Begin() initialize every fields (as we allow user to call Begin/End multiple times on a same instance if they want).
~ImGuiListClipper(){IM_ASSERT(ItemsCount==-1);}// Assert if user forgot to call End() or Step() until false.
IMGUI_APIboolStep();// Call until it returns false. The DisplayStart/DisplayEnd fields will be set and you can process/draw those items.
IMGUI_APIvoidBegin(intitems_count,floatitems_height=-1.0f);// Automatically called by constructor if you passed 'items_count' or by Step() in Step 1.
IMGUI_APIvoidEnd();// Automatically called on the last call of Step() that returns false.
#define IM_COL32_BLACK_TRANS (0x00000000) // Transparent black
// 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, 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()'
// Typically, 1 command = 1 gpu draw call (unless command is a callback)
structImDrawCmd
{
unsignedintElemCount;// Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[].
ImTextureIDTextureId;// User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas.
ImDrawCallbackUserCallback;// If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
void*UserCallbackData;// The draw callback code can access this.
// Vertex index (override with '#define ImDrawIdx unsigned int' inside in imconfig.h)
#ifndef ImDrawIdx
typedefunsignedshortImDrawIdx;
#endif
// Vertex layout
#ifndef IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT
structImDrawVert
{
ImVec2pos;
ImVec2uv;
ImU32col;
};
#else
// You can override the vertex format layout by defining IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT in imconfig.h
// The code expect ImVec2 pos (8 bytes), ImVec2 uv (8 bytes), ImU32 col (4 bytes), but you can re-order them or add other fields as needed to simplify integration in your engine.
// The type has to be described within the macro (you can either declare the struct or use a typedef)
IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT;
#endif
// Draw channels are used by the Columns API to "split" the render list into different channels while building, so items of each column can be batched together.
// You can also use them to simulate drawing layers and submit primitives in a different order than how they will be rendered.
structImDrawChannel
{
ImVector<ImDrawCmd>CmdBuffer;
ImVector<ImDrawIdx>IdxBuffer;
};
// 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.
// At the moment, each ImGui window contains its own ImDrawList but they could potentially be merged in the future.
// If you want to add custom rendering within a window, you can use ImGui::GetWindowDrawList() to access the current draw list and add your own primitives.
// You can interleave normal ImGui:: calls and adding primitives to the current draw list.
// All positions are in screen coordinates (0,0=top-left, 1 pixel per unit). Primitives are always added to the list and not culled (culling is done at render time and at a higher-level by ImGui:: functions).
structImDrawList
{
// This is what you have to render
ImVector<ImDrawCmd>CmdBuffer;// Commands. Typically 1 command = 1 gpu draw call.
ImVector<ImDrawIdx>IdxBuffer;// Index buffer. Each command consume ImDrawCmd::ElemCount of those
ImVector<ImDrawVert>VtxBuffer;// Vertex buffer.
// [Internal, used while building lists]
constchar*_OwnerName;// Pointer to owner window's name (if any) for debugging
ImVector<ImVec2>_Path;// [Internal] current path building
int_ChannelsCurrent;// [Internal] current channel number (0)
int_ChannelsCount;// [Internal] number of active channels (1+)
ImVector<ImDrawChannel>_Channels;// [Internal] draw channels for columns API (not resized down so _ChannelsCount may be smaller than _Channels.Size)
ImDrawList(){_OwnerName=NULL;Clear();}
~ImDrawList(){ClearFreeMemory();}
IMGUI_APIvoidPushClipRect(ImVec2clip_rect_min,ImVec2clip_rect_max,boolintersect_with_current_clip_rect=false);// Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
// - Use to simulate layers. By switching channels to can render out-of-order (e.g. submit foreground primitives before background primitives)
// - Use to minimize draw calls (e.g. if going back-and-forth between multiple non-overlapping clipping rectangles, prefer to append into separate channels then merge at the end)
IMGUI_APIvoidAddCallback(ImDrawCallbackcallback,void*callback_data);// Your rendering function must check for 'UserCallback' in ImDrawCmd and call the function instead of rendering triangles.
IMGUI_APIvoidAddDrawCmd();// This is useful if you need to forcefully create a new draw call (to allow for dependent rendering / blending). Otherwise primitives are merged into the same draw-call as much as possible
// Internal helpers
// NB: all primitives needs to be reserved via PrimReserve() beforehand!
IMGUI_APIvoidDeIndexAllBuffers();// For backward compatibility: convert all buffers from indexed to de-indexed, in case you cannot render indexed. Note: this is slow and most likely a waste of resources. Always prefer indexed rendering!
IMGUI_APIvoidScaleClipRects(constImVec2&sc);// Helper to scale the ClipRect field of each ImDrawCmd. Use if your final output buffer is at a different scale than ImGui expects, or if there is a difference between your window resolution and framebuffer resolution.
};
structImFontConfig
{
void*FontData;// // TTF data
intFontDataSize;// // TTF data size
boolFontDataOwnedByAtlas;// true // TTF data ownership taken by the container ImFontAtlas (will delete memory itself). Set to true
intFontNo;// 0 // Index of font within TTF file
floatSizePixels;// // Size in pixels for rasterizer
intOversampleH,OversampleV;// 3, 1 // Rasterize at higher quality for sub-pixel positioning. We don't use sub-pixel positions on the Y axis.
boolPixelSnapH;// false // Align every glyph to pixel boundary. Useful e.g. if you are merging a non-pixel aligned font with the default font. If enabled, you can set OversampleH/V to 1.
ImVec2GlyphExtraSpacing;// 0, 0 // Extra spacing (in pixels) between glyphs
constImWchar*GlyphRanges;// // Pointer to a user-provided list of Unicode range (2 value per range, values are inclusive, zero-terminated list). THE ARRAY DATA NEEDS TO PERSIST AS LONG AS THE FONT IS ALIVE.
boolMergeMode;// false // Merge into previous ImFont, so you can combine multiple inputs font into one ImFont (e.g. ASCII font + icons + Japanese glyphs).
boolMergeGlyphCenterV;// false // When merging (multiple ImFontInput for one ImFont), vertically center new glyphs instead of aligning their baseline
// [Internal]
charName[32];// Name (strictly for debugging)
ImFont*DstFont;
IMGUI_APIImFontConfig();
};
// Load and rasterize multiple TTF fonts into a same texture.
// Sharing a texture for multiple fonts allows us to reduce the number of draw calls during rendering.
// We also add custom graphic data into the texture that serves for ImGui.
// 1. (Optional) Call AddFont*** functions. If you don't call any, the default font will be loaded for you.
// 2. Call GetTexDataAsAlpha8() or GetTexDataAsRGBA32() to build and retrieve pixels data.
// 3. Upload the pixels data into a texture within your graphics system.
// 4. Call SetTexID(my_tex_id); and pass the pointer/identifier to your texture. This value will be passed back to you during rendering to identify the texture.
// 5. Call ClearTexData() to free textures memory on the heap.
// NB: If you use a 'glyph_ranges' array you need to make sure that your array persist up until the ImFont is cleared. We only copy the pointer, not the data.
IMGUI_APIImFont*AddFontFromMemoryTTF(void*ttf_data,intttf_size,floatsize_pixels,constImFontConfig*font_cfg=NULL,constImWchar*glyph_ranges=NULL);// Transfer ownership of 'ttf_data' to ImFontAtlas, will be deleted after Build()
IMGUI_APIImFont*AddFontFromMemoryCompressedTTF(constvoid*compressed_ttf_data,intcompressed_ttf_size,floatsize_pixels,constImFontConfig*font_cfg=NULL,constImWchar*glyph_ranges=NULL);// 'compressed_ttf_data' still owned by caller. Compress with binary_to_compressed_c.cpp
IMGUI_APIImFont*AddFontFromMemoryCompressedBase85TTF(constchar*compressed_ttf_data_base85,floatsize_pixels,constImFontConfig*font_cfg=NULL,constImWchar*glyph_ranges=NULL);// 'compressed_ttf_data_base85' still owned by caller. Compress with binary_to_compressed_c.cpp with -base85 paramaeter
IMGUI_APIvoidClearTexData();// Clear the CPU-side texture data. Saves RAM once the texture has been copied to graphics memory.
IMGUI_APIvoidClearInputData();// Clear the input TTF data (inc sizes, glyph ranges)
IMGUI_APIvoidClearFonts();// Clear the ImGui-side font data (glyphs storage, UV coordinates)
IMGUI_APIvoidClear();// Clear all
// Retrieve texture data
// User is in charge of copying the pixels into graphics memory, then call SetTextureUserID()
// After loading the texture into your graphic system, store your texture handle in 'TexID' (ignore if you aren't using multiple fonts nor images)
// RGBA32 format is provided for convenience and high compatibility, but note that all RGB pixels are white, so 75% of the memory is wasted.
// Helpers to retrieve list of common Unicode ranges (2 value per range, values are inclusive, zero-terminated list)
// NB: Make sure that your string are UTF-8 and NOT in your local code page. See FAQ for details.
IMGUI_APIconstImWchar*GetGlyphRangesDefault();// Basic Latin, Extended Latin
IMGUI_APIconstImWchar*GetGlyphRangesKorean();// Default + Korean characters
IMGUI_APIconstImWchar*GetGlyphRangesJapanese();// Default + Hiragana, Katakana, Half-Width, Selection of 1946 Ideographs
IMGUI_APIconstImWchar*GetGlyphRangesChinese();// Japanese + full set of about 21000 CJK Unified Ideographs
IMGUI_APIconstImWchar*GetGlyphRangesCyrillic();// Default + about 400 Cyrillic characters
// Members
// (Access texture data via GetTexData*() calls which will setup a default font for you.)
void*TexID;// User data to refer to the texture once it has been uploaded to user's graphic systems. It ia passed back to you during rendering.
unsignedchar*TexPixelsAlpha8;// 1 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight
unsignedint*TexPixelsRGBA32;// 4 component per pixel, each component is unsigned 8-bit. Total size = TexWidth * TexHeight * 4
intTexWidth;// Texture width calculated during Build().
intTexHeight;// Texture height calculated during Build().
intTexDesiredWidth;// Texture width desired by user before Build(). Must be a power-of-two. If have many glyphs your graphics API have texture size restrictions you may want to increase texture width to decrease height.
ImVec2TexUvWhitePixel;// Texture coordinates to a white pixel
ImVector<ImFont*>Fonts;// Hold all the fonts returned by AddFont*. Fonts[0] is the default font upon calling ImGui::NewFrame(), use ImGui::PushFont()/PopFont() to change the current font.
// Private
ImVector<ImFontConfig>ConfigData;// Internal data
IMGUI_APIboolBuild();// Build pixels data. This is automatically for you by the GetTexData*** functions.
// ImFontAtlas automatically loads a default embedded font for you when you call GetTexDataAsAlpha8() or GetTexDataAsRGBA32().
structImFont
{
structGlyph
{
ImWcharCodepoint;
floatXAdvance;
floatX0,Y0,X1,Y1;
floatU0,V0,U1,V1;// Texture coordinates
};
// Members: Hot ~62/78 bytes
floatFontSize;// <user set> // Height of characters, set during loading (don't change after loading)
floatScale;// = 1.f // Base font scale, multiplied by the per-window font scale which you can adjust with SetFontScale()
ImVec2DisplayOffset;// = (0.f,1.f) // Offset font rendering by xx pixels
ImVector<Glyph>Glyphs;// // All glyphs.
ImVector<float>IndexXAdvance;// // Sparse. Glyphs->XAdvance in a directly indexable way (more cache-friendly, for CalcTextSize functions which are often bottleneck in large UI).
ImVector<unsignedshort>IndexLookup;// // Sparse. Index glyphs by Unicode code-point.
ImWcharFallbackChar;// = '?' // Replacement glyph if one isn't found. Only set via SetFallbackChar()
// Members: Cold ~18/26 bytes
shortConfigDataCount;// ~ 1 // Number of ImFontConfig involved in creating this font. Bigger than 1 when merging multiple font sources into one ImFont.
ImFontConfig*ConfigData;// // Pointer within ContainerAtlas->ConfigData
ImFontAtlas*ContainerAtlas;// // What we has been loaded into
floatAscent,Descent;// // Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
IMGUI_APIvoidAddRemapChar(ImWchardst,ImWcharsrc,booloverwrite_dst=true);// Makes 'dst' character/glyph points to 'src' character/glyph. Currently needs to be called AFTER fonts have been built.