@ -25,4 +25,5 @@ If you have been using dear imgui for a while and/or have been using C/C++ for s
## How to create an Pull Request
## How to create an Pull Request
- If you are adding a feature, please explain the context of the change: what do you need the feature for?
- If you are adding a feature, please explain the context of the change: what do you need the feature for?
- Try to attach screenshots to clarify the context and demonstrate the feature at a glance.
- Make sure you create a branch for the pull request. In Git, 1 PR is associated to 1 branch. If you keep pushing to the same branch after you submitted the PR, your new commits will appear in the PR.
- Make sure you create a branch for the pull request. In Git, 1 PR is associated to 1 branch. If you keep pushing to the same branch after you submitted the PR, your new commits will appear in the PR.
- If you are adding a feature, please explain the context of the change: what do you need the feature for?
- If you are adding a feature, please explain the context of the change: what do you need the feature for?
- Try to attach screenshots to clarify the context and demonstrate the feature at a glance.
- Make sure you create a branch for the pull request. In Git, 1 PR is associated to 1 branch. If you keep pushing to the same branch after you submitted the PR, your new commits will appear in the PR.
- Make sure you create a branch for the pull request. In Git, 1 PR is associated to 1 branch. If you keep pushing to the same branch after you submitted the PR, your new commits will appear in the PR.
- You can read [CONTRIBUTING.md](https://github.com/ocornut/imgui/blob/master/.github/CONTRIBUTING.md) for more details.
- You can read [CONTRIBUTING.md](https://github.com/ocornut/imgui/blob/master/.github/CONTRIBUTING.md) for more details.
// class ImVector<> // Lightweight std::vector like class.
// IMGUI_ONCE_UPON_A_FRAME // Execute a block of code once per frame only (convenient for creating UI within deep-nested code that runs multiple times)
structImVec2
structImVec2
{
{
floatx,y;
floatx,y;
ImVec2(){x=y=0.0f;}
ImVec2(){x=y=0.0f;}
ImVec2(float_x,float_y){x=_x;y=_y;}
ImVec2(float_x,float_y){x=_x;y=_y;}
floatoperator[](size_tidx)const{IM_ASSERT(idx==0||idx==1);return(&x)[idx];}// We very rarely use this [] operator, thus an assert is fine.
floatoperator[](size_tidx)const{IM_ASSERT(idx<=1);return(&x)[idx];}// We very rarely use this [] operator, thus an assert is fine.
#ifdef IM_VEC2_CLASS_EXTRA // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec2.
#ifdef IM_VEC2_CLASS_EXTRA // Define constructor and implicit cast operators in imconfig.h to convert back<>forth from your math types and ImVec2.
IM_VEC2_CLASS_EXTRA
IM_VEC2_CLASS_EXTRA
#endif
#endif
@ -692,10 +688,10 @@ enum ImGuiDragDropFlags_
};
};
// Standard Drag and Drop payload types. You can define you own payload types using 12-characters long strings. Types starting with '_' are defined by Dear ImGui.
// Standard Drag and Drop payload types. You can define you own payload types using 12-characters long strings. Types starting with '_' are defined by Dear ImGui.
#define IMGUI_PAYLOAD_TYPE_COLOR_3F "_COL3F" // float[3] // Standard type for colors, without alpha. User code may use this type.
#define IMGUI_PAYLOAD_TYPE_COLOR_3F "_COL3F" // float[3]: Standard type for colors, without alpha. User code may use this type.
#define IMGUI_PAYLOAD_TYPE_COLOR_4F "_COL4F" // float[4] // Standard type for colors. User code may use this type.
#define IMGUI_PAYLOAD_TYPE_COLOR_4F "_COL4F" // float[4]: Standard type for colors. User code may use this type.
// A direction
// A cardinal direction
enumImGuiDir_
enumImGuiDir_
{
{
ImGuiDir_None=-1,
ImGuiDir_None=-1,
@ -840,15 +836,13 @@ enum ImGuiCol_
ImGuiCol_DragDropTarget,
ImGuiCol_DragDropTarget,
ImGuiCol_NavHighlight,// gamepad/keyboard: current highlighted item
ImGuiCol_NavHighlight,// gamepad/keyboard: current highlighted item
ImGuiCol_NavWindowingHighlight,// gamepad/keyboard: when holding NavMenu to focus/move/resize windows
ImGuiCol_NavWindowingHighlight,// gamepad/keyboard: when holding NavMenu to focus/move/resize windows
ImGuiCol_COUNT
// Obsolete names (will be removed)
// Obsolete names (will be removed)
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
ImGuiCol_CloseButton,ImGuiCol_CloseButtonActive,ImGuiCol_CloseButtonHovered,// [unused since 1.60+] the close button now uses regular button colors.
ImGuiCol_ComboBg,// [unused since 1.53+] ComboBg has been merged with PopupBg, so a redirect isn't accurate.
//ImGuiCol_CloseButton, ImGuiCol_CloseButtonActive, ImGuiCol_CloseButtonHovered, // [unused since 1.60+] the close button now uses regular button colors.
ImGuiCol_COUNT,
//ImGuiCol_ComboBg, // [unused since 1.53+] ComboBg has been merged with PopupBg, so a redirect isn't accurate.
ImGuiColorEditFlags_NoTooltip=1<<6,// // ColorEdit, ColorPicker, ColorButton: disable tooltip when hovering the preview.
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_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.
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.
// 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_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_AlphaPreview=1<<10,// // ColorEdit, ColorPicker, ColorButton: display preview as a transparent color over a checkerboard, instead of opaque.
@ -910,7 +905,8 @@ enum ImGuiColorEditFlags_
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_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_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.
ImGuiColorEditFlags_PickerHueWheel=1<<19,// [PickerMode] // ColorPicker: wheel for Hue, triangle for Sat/Value.
// 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).
// 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/destructors. This is intentional and we do not require it. Do not use this class as a straight std::vector replacement in your code!
// Our implementation does NOT call C++ constructors/destructors. This is intentional and we do not require it. Do not use this class as a straight std::vector replacement in your code!
// 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.
// Helper: execute a block of code at maximum once a frame. Convenient if you want to quickly create an UI within deep-nested code that runs multiple times every frame.
// Helper: execute a block of code at maximum once a frame. Convenient if you want to quickly create an UI within deep-nested code that runs multiple times every frame.
// Usage:
// Usage: static ImGuiOnceUponAFrame oaf; if (oaf) ImGui::Text("This will be called only once per frame");
// static ImGuiOnceUponAFrame oaf;
// if (oaf)
// ImGui::Text("This will be called only once per frame");
structImGuiOnceUponAFrame
structImGuiOnceUponAFrame
{
{
ImGuiOnceUponAFrame(){RefFrame=-1;}
ImGuiOnceUponAFrame(){RefFrame=-1;}
@ -1675,7 +1675,8 @@ struct ImFontConfig
boolFontDataOwnedByAtlas;// true // TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself).
boolFontDataOwnedByAtlas;// true // TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself).
intFontNo;// 0 // Index of font within TTF/OTF file
intFontNo;// 0 // Index of font within TTF/OTF file
floatSizePixels;// // Size in pixels for rasterizer.
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.
intOversampleH;// 3 // Rasterize at higher quality for sub-pixel positioning. We don't use sub-pixel positions on the Y axis.
intOversampleV;// 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.
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. Only X axis is supported for now.
ImVec2GlyphExtraSpacing;// 0, 0 // Extra spacing (in pixels) between glyphs. Only X axis is supported for now.
ImVec2GlyphOffset;// 0, 0 // Offset all glyphs from this font input.
ImVec2GlyphOffset;// 0, 0 // Offset all glyphs from this font input.
@ -1786,7 +1787,7 @@ struct ImFontAtlas
IMGUI_APIintAddCustomRectFontGlyph(ImFont*font,ImWcharid,intwidth,intheight,floatadvance_x,constImVec2&offset=ImVec2(0,0));// Id needs to be < 0x10000 to register a rectangle to map into a specific font.
IMGUI_APIintAddCustomRectFontGlyph(ImFont*font,ImWcharid,intwidth,intheight,floatadvance_x,constImVec2&offset=ImVec2(0,0));// Id needs to be < 0x10000 to register a rectangle to map into a specific font.
// 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.