@ -71,7 +71,7 @@ typedef int ImGuiCol; // a color identifier for styling // e
typedefintImGuiStyleVar;// a variable identifier for styling // enum ImGuiStyleVar_
typedefintImGuiKey;// a key identifier (ImGui-side enum) // enum ImGuiKey_
typedefintImGuiNavInput;// an input identifier for gamepad nav // enum ImGuiNavInput_
typedefintImGuiColorEditMode;// color edit mode for ColorEdit*() // enum ImGuiColorEditMode_
typedefintImGuiColorEditFlags;// color edit flags for Color*() // enum ImGuiColorEditFlags_
typedefintImGuiMouseCursor;// a mouse cursor identifier // enum ImGuiMouseCursor_
typedefintImGuiWindowFlags;// window flags for Begin*() // enum ImGuiWindowFlags_
typedefintImGuiSetCond;// condition flags for Set*() // enum ImGuiSetCond_
@ -191,6 +191,7 @@ namespace ImGui
IMGUI_APIImVec2GetFontTexUvWhitePixel();// get UV coordinate for a while pixel, useful to draw custom shapes via the ImDrawList API
IMGUI_APIImU32GetColorU32(ImGuiColidx,floatalpha_mul=1.0f);// retrieve given style color with style alpha applied and optional extra alpha multiplier
IMGUI_APIImU32GetColorU32(constImVec4&col);// retrieve given color with style alpha applied
IMGUI_APIImU32GetColorU32(ImU32col);// retrieve given color with style alpha applied
// Parameters stacks (current window)
IMGUI_APIvoidPushItemWidth(floatitem_width);// width of items for the common item+label case, pixels. 0.0f = default to ~2/3 of windows width, >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)
@ -245,7 +246,7 @@ namespace ImGui
IMGUI_APIvoidPushID(constvoid*ptr_id);
IMGUI_APIvoidPushID(intint_id);
IMGUI_APIvoidPopID();
IMGUI_APIImGuiIDGetID(constchar*str_id);// calculate unique ID (hash of whole ID stack + given parameter). useful if you want to query into ImGuiStorage yourself. otherwise rarely needed
IMGUI_APIImGuiIDGetID(constchar*str_id);// calculate unique ID (hash of whole ID stack + given parameter). useful if you want to query into ImGuiStorage yourself
IMGUI_APIboolCombo(constchar*label,int*current_item,constchar*items_separated_by_zeros,intheight_in_items=-1);// separate items with \0, end item-list with \0\0
IMGUI_APIboolCombo(constchar*label,int*current_item,constchar*items_separated_by_zeros,intheight_in_items=-1);// separate items with \0, end item-list with \0\0
IMGUI_APIboolColorEdit3(constchar*label,floatcol[3]);// Hint: 'float col[3]' function argument is same as 'float* col'. You can pass address of first element out of a contiguous set, e.g. &myvector.x
// Widgets: Drags (tip: ctrl+click on a drag box to input with keyboard. manually input values aren't clamped, can go off-bounds)
// For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every functions, remember than a 'float v[3]' function argument is the same as 'float* v'. You can pass address of your first element out of a contiguous set, e.g. &myvector.x
// For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every functions, note that a 'float v[X]' function argument is the same as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x
// Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For gamepad/keyboard navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision).
IMGUI_APIboolDragFloat(constchar*label,float*v,floatv_speed=1.0f,floatv_min=0.0f,floatv_max=0.0f,constchar*display_format="%.3f",floatpower=1.0f);// If v_min >= v_max we have no bound
// Widgets: Sliders (tip: ctrl+click on a slider to input with keyboard. manually input values aren't clamped, can go off-bounds)
IMGUI_APIboolSliderFloat(constchar*label,float*v,floatv_min,floatv_max,constchar*display_format="%.3f",floatpower=1.0f);// adjust display_format to decorate the value with a prefix or a suffix. Use power!=1.0 for logarithmic sliders
IMGUI_APIboolSliderFloat(constchar*label,float*v,floatv_min,floatv_max,constchar*display_format="%.3f",floatpower=1.0f);// adjust display_format to decorate the value with a prefix or a suffix for in-slider labels or unit display. Use power!=1.0 for logarithmic sliders
// Widgets: Color Editor/Picker (tip: the ColorEdit* functions have a little colored preview square that can be left-clicked to open a picker, and right-clicked to open an option menu.)
// Note that a 'float v[X]' function argument is the same as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can the pass the address of a first float element out of a contiguous structure, e.g. &myvector.x
IMGUI_APIboolColorButton(constchar*desc_id,constImVec4&col,ImGuiColorEditFlagsflags=0,ImVec2size=ImVec2(0,0));// display a colored square/button, hover for details, return true when pressed.
IMGUI_APIvoidSetColorEditOptions(ImGuiColorEditFlagsflags);// initialize current options (generally on application startup) if you want to select a default format, picker type, etc. User will be able to change many settings, unless you pass the _NoOptions flag to your calls.
// Widgets: Trees
IMGUI_APIboolTreeNode(constchar*label);// if returning 'true' the node is open and the tree id is pushed into the id stack. user is responsible for calling TreePop().
IMGUI_APIboolTreeNode(constchar*str_id,constchar*fmt,...)IM_PRINTFARGS(2);// read the FAQ about why and how to use ID. to align arbitrary text at the same level as a TreeNode() you can use Bullet().
@ -456,7 +462,7 @@ namespace ImGui
IMGUI_APIImVec2GetMousePosOnOpeningCurrentPopup();// retrieve backup of mouse positioning at the time of opening popup we have BeginPopup() into
IMGUI_APIImVec2GetMouseDragDelta(intbutton=0,floatlock_threshold=-1.0f);// dragging amount since clicking. if lock_threshold < -1.0f uses io.MouseDraggingThreshold
IMGUI_APIvoidResetMouseDragDelta(intbutton=0);//
IMGUI_APIImGuiMouseCursorGetMouseCursor();// get desired cursor type, reset in ImGui::NewFrame(), this updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
IMGUI_APIImGuiMouseCursorGetMouseCursor();// get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
IMGUI_APIvoidSetMouseCursor(ImGuiMouseCursortype);// set desired cursor type
IMGUI_APIvoidCaptureKeyboardFromApp(boolcapture=true);// manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application handle). e.g. force capture keyboard when your widget is being hovered.
IMGUI_APIvoidCaptureMouseFromApp(boolcapture=true);// manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application handle).
@ -697,15 +703,34 @@ enum ImGuiStyleVar_
ImGuiStyleVar_Count_
};
// Enumeration for ColorEditMode()
// FIXME-OBSOLETE: Will be replaced by future color/picker api
ImGuiColorEditFlags_NoAlpha=1<<1,// // ColorEdit, ColorPicker, ColorButton: ignore Alpha component (read 3 components from the input pointer).
ImGuiColorEditFlags_NoPicker=1<<2,// // ColorEdit: disable picker when clicking on colored square.
ImGuiColorEditFlags_NoOptions=1<<3,// // ColorEdit: disable toggling options menu when right-clicking on inputs/small preview.
ImGuiColorEditFlags_NoSmallPreview=1<<4,// // ColorEdit, ColorPicker: disable colored square preview next to the inputs. (e.g. to show only the inputs)
ImGuiColorEditFlags_NoInputs=1<<5,// // ColorEdit, ColorPicker: disable inputs sliders/text widgets (e.g. to show only the small preview colored square).
ImGuiColorEditFlags_NoTooltip=1<<6,// // ColorEdit, ColorPicker, ColorButton: disable tooltip when hovering the preview.
ImGuiColorEditFlags_NoLabel=1<<7,// // ColorEdit, ColorPicker: disable display of inline text label (the label is still forwarded to the tooltip and picker).
ImGuiColorEditFlags_NoSidePreview=1<<8,// // ColorPicker: disable bigger color preview on right side of the picker, use small colored square preview instead.
// User Options (right-click on widget to change some of them). You can set application defaults using SetColorEditOptions(). The idea is that you probably don't want to override them in most of your calls, let the user choose and/or call SetColorEditOptions() during startup.
ImGuiColorEditFlags_AlphaBar=1<<9,// // ColorEdit, ColorPicker: show vertical alpha bar/gradient in picker.
ImGuiColorEditFlags_AlphaPreview=1<<10,// // ColorEdit, ColorPicker, ColorButton: display preview as a transparent color over a checkerboard, instead of opaque.
ImGuiColorEditFlags_HDR=1<<12,// // (WIP) ColorEdit: Currently only disable 0.0f..1.0f limits in RGBA edition (note: you probably want to use ImGuiColorEditFlags_Float flag as well).
ImGuiColorEditFlags_RGB=1<<13,// [Inputs] // ColorEdit: choose one among RGB/HSV/HEX. ColorPicker: choose any combination using RGB/HSV/HEX.
ImGuiColorEditFlags_Float=1<<17,// [DataType] // ColorEdit, ColorPicker, ColorButton: _display_ values formatted as 0.0f..1.0f floats instead of 0..255 integers. No round-trip of value via integers.
ImGuiColorEditFlags_PickerHueBar=1<<18,// [PickerMode] // ColorPicker: bar for Hue, rectangle for Sat/Value.
ImGuiColorEditFlags_PickerHueWheel=1<<19,// [PickerMode] // ColorPicker: wheel for Hue, triangle for Sat/Value.
ImGui::SameLine();ShowHelpMarker("Click on the colored square to change edit mode.\nCTRL+click on individual component to input value.\n");
ImGui::SameLine();ShowHelpMarker("Click on the colored square to open a color picker.\nRight-click on the colored square to show options.\nCTRL+click on individual component to input value.\n");
ImGui::SameLine();ShowHelpMarker("With the ImGuiColorEditFlags_NoInputs flag you can hide all the slider/text inputs.\nWith the ImGuiColorEditFlags_NoLabel flag you can pass a non-empty label which will only be used for the tooltip and picker popup.");
ImGui::Text("Programmatically set defaults/options:");
ImGui::SameLine();ShowHelpMarker("SetColorEditOptions() is designed to allow you to set boot-time default.\nWe don't have Push/Pop functions because you can force options on a per-widget basis if needed, and the user can change non-forced ones with the options menu.\nWe don't have a getter to avoid encouraging you to persistently save values that aren't forward-compatible.");
// We call C++ constructor on own allocated memory via the placement "new(ptr) Type()" syntax.
// Defining a custom placement new() with a dummy parameter allows us to bypass including <new> which on some platforms complains when user has disabled exceptions.
@ -211,13 +221,13 @@ enum ImGuiInputSource
ImGuiInputSource_Count_,
};
enumImGuiNavDir
enumImGuiDir
{
ImGuiNavDir_None=-1,
ImGuiNavDir_Left=0,
ImGuiNavDir_Right=1,
ImGuiNavDir_Up=2,
ImGuiNavDir_Down=3,
ImGuiDir_None=-1,
ImGuiDir_Left=0,
ImGuiDir_Right=1,
ImGuiDir_Up=2,
ImGuiDir_Down=3,
};
enumImGuiCorner
@ -444,7 +454,7 @@ struct ImGuiContext
boolNavInitDefaultResultExplicit;// Whether the result was explicitly requested with SetItemDefaultFocus()
boolNavMoveRequest;// Move request for this frame
boolNavMoveFromClampedRefRect;// Set by manual scrolling, if we scroll to a point where NavId isn't visible we reset navigation from visible items
ImGuiNavDirNavMoveDir;// West/East/North/South
ImGuiDirNavMoveDir;// West/East/North/South
ImGuiIDNavMoveResultId;// Best move request candidate
floatNavMoveResultDistBox;// Best move request candidate box distance to current NavId
floatNavMoveResultDistCenter;// Best move request candidate center distance to current NavId
@ -480,7 +490,8 @@ struct ImGuiContext
ImGuiTextEditStateInputTextState;
ImFontInputTextPasswordFont;
ImGuiIDScalarAsInputTextId;// Temporary text input when CTRL+clicking on a slider, etc.
ImGuiStorageColorEditModeStorage;// Store user selection of color edit mode
ImGuiColorEditFlagsColorEditOptions;// Store user options for color edit widgets
ImVec4ColorPickerRef;
floatDragCurrentValue;// Currently dragged value, always float, not rounded by end-user precision settings
ImVec2DragLastMouseDelta;
floatDragSpeedDefaultRatio;// If speed == 0.0f, uses (max-min) * DragSpeedDefaultRatio
// NB: All position are in absolute pixels coordinates (not window coordinates)
// FIXME: All those functions are a mess and needs to be refactored into something decent. AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION.
// We need: a sort of symbol library, preferably baked into font atlas when possible + decent text rendering helpers.
// NB: All position are in absolute pixels coordinates (never using window coordinates internally)
// AVOID USING OUTSIDE OF IMGUI.CPP! NOT FOR PUBLIC CONSUMPTION. THOSE FUNCTIONS ARE A MESS. THEIR SIGNATURE AND BEHAVIOR WILL CHANGE, THEY NEED TO BE REFACTORED INTO SOMETHING DECENT.
IMGUI_APIboolTreeNodeBehaviorIsOpen(ImGuiIDid,ImGuiTreeNodeFlagsflags=0);// Consume previous SetNextTreeNodeOpened() data, if any. May return true when logging