You should be able to build the examples from sources (tested on Windows/Mac/Linux). If you don't, let me know! If you want to have a quick look at the features of ImGui, you can download binaries of the demo app here.
You should be able to build the examples from sources (tested on Windows/Mac/Linux). If you don't, let me know! If you want to have a quick look at the features of ImGui, you can download binaries of the demo app here.
ImGui can load TTF fonts. UTF-8 is supported for text display and input. Here using Arial Unicode font to display Japanese. Initialize custom font with:
ImGui can load TTF fonts. UTF-8 is supported for text display and input. Here using Arial Unicode font to display Japanese. Initialize custom font with:
Inspiration, feedback, and testing for early versions: Casey Muratori, Atman Binstock, Mikko Mononen, Emmanuel Briney, Stefan Kamoda, Anton Mikhailov, Matt Willis. And everybody posting feedback, questions and patches on the GitHub.
Inspiration, feedback, and testing for early versions: Casey Muratori, Atman Binstock, Mikko Mononen, Emmanuel Briney, Stefan Kamoda, Anton Mikhailov, Matt Willis. And everybody posting feedback, questions and patches on the GitHub.
ImGui is financially supported on [**Patreon**](http://www.patreon.com/imgui).
ImGui development is financially supported on [**Patreon**](http://www.patreon.com/imgui).
Special supporters
Special supporters:
- Jetha Chan, Mārtiņš Možeiko, Alex Evans, Pastagames, Wild Sheep Studio
- Jetha Chan, Wild Sheep Studio, Pastagames, Mārtiņš Možeiko, Daniel Collin, Stefano Cristiano.
And
And:
- Dale Kim, Michel Courtine, Paul Patrashcu, Rui Figueira
- Michel Courtine, César Leblic, Dale Kim, Alex Evans, Rui Figueira, Paul Patrashcu, Jerome Lanquetot, Ctrl Alt Ninja, Paul Fleming, Neil Henning, Stephan Dilly.
// - struct ImGuiTextBuffer // Text buffer for logging/accumulating text
// - struct ImGuiTextBuffer // Text buffer for logging/accumulating text
// - struct ImGuiStorage // Custom key value storage (if you need to alter open/close states manually)
// - struct ImGuiStorage // Custom key value storage (if you need to alter open/close states manually)
// - struct ImGuiTextEditCallbackData // Shared state of ImGui::InputText() when using custom callbacks
// - struct ImGuiTextEditCallbackData // Shared state of ImGui::InputText() when using custom callbacks
// - struct ImGuiListClipper // Helper to manually clip large list of items.
// - struct ImColor // Helper functions to created packed 32-bit RGBA color values
// - struct ImColor // Helper functions to created packed 32-bit RGBA color values
// - struct ImDrawList // Draw command list
// - struct ImDrawList // Draw command list
// - struct ImFontAtlas // Bake multiple fonts into a single texture, TTF font loader, bake glyphs into bitmap
// - struct ImFontAtlas // Bake multiple fonts into a single texture, TTF font loader, bake glyphs into bitmap
@ -115,10 +116,10 @@ namespace ImGui
IMGUI_APIImFont*GetWindowFont();
IMGUI_APIImFont*GetWindowFont();
IMGUI_APIfloatGetWindowFontSize();// size (also height in pixels) of current font with current scale applied
IMGUI_APIfloatGetWindowFontSize();// size (also height in pixels) of current font with current scale applied
IMGUI_APIvoidSetWindowFontScale(floatscale);// per-window font scale. Adjust IO.FontGlobalScale if you want to scale all windows
IMGUI_APIvoidSetWindowFontScale(floatscale);// per-window font scale. Adjust IO.FontGlobalScale if you want to scale all windows
IMGUI_APIImVec2GetWindowPos();// you should rarely need/care about the window position, but it can be useful if you want to do your own drawing
IMGUI_APIImVec2GetWindowPos();// get current window position in screen space (useful if you want to do your own drawing via the DrawList api)
IMGUI_APIImVec2GetWindowSize();// get current window position
IMGUI_APIImVec2GetWindowSize();// get current window size
IMGUI_APIfloatGetWindowWidth();
IMGUI_APIfloatGetWindowWidth();
IMGUI_APIboolGetWindowCollapsed();
IMGUI_APIboolIsWindowCollapsed();
IMGUI_APIvoidSetNextWindowPos(constImVec2&pos,ImGuiSetCondcond=0);// set next window position - call before Begin()
IMGUI_APIvoidSetNextWindowPos(constImVec2&pos,ImGuiSetCondcond=0);// set next window position - call before Begin()
IMGUI_APIvoidSetNextWindowSize(constImVec2&size,ImGuiSetCondcond=0);// set next window size. set to ImVec2(0,0) to force an auto-fit
IMGUI_APIvoidSetNextWindowSize(constImVec2&size,ImGuiSetCondcond=0);// set next window size. set to ImVec2(0,0) to force an auto-fit
@ -157,6 +158,8 @@ namespace ImGui
IMGUI_APIvoidPopAllowKeyboardFocus();
IMGUI_APIvoidPopAllowKeyboardFocus();
IMGUI_APIvoidPushTextWrapPos(floatwrap_pos_x=0.0f);// word-wrapping for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space
IMGUI_APIvoidPushTextWrapPos(floatwrap_pos_x=0.0f);// word-wrapping for Text*() commands. < 0.0f: no wrapping; 0.0f: wrap to end of window (or column); > 0.0f: wrap at 'wrap_pos_x' position in window local space
IMGUI_APIvoidPopTextWrapPos();
IMGUI_APIvoidPopTextWrapPos();
IMGUI_APIvoidPushButtonRepeat(boolrepeat);// in 'repeat' mode, Button*() functions return true multiple times as you hold them (uses io.KeyRepeatDelay/io.KeyRepeatRate for now)
IMGUI_APIvoidPopButtonRepeat();
// Tooltip
// Tooltip
IMGUI_APIvoidSetTooltip(constchar*fmt,...);// set tooltip under mouse-cursor, typically use with ImGui::IsHovered(). last call wins
IMGUI_APIvoidSetTooltip(constchar*fmt,...);// set tooltip under mouse-cursor, typically use with ImGui::IsHovered(). last call wins
@ -165,15 +168,21 @@ namespace ImGui
IMGUI_APIvoidEndTooltip();
IMGUI_APIvoidEndTooltip();
// Popup
// Popup
IMGUI_APIvoidBeginPopup(bool*p_opened);
IMGUI_APIvoidOpenPopup(constchar*str_id);// mark popup as open. popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level). close childs popups if any. will close popup when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block.
IMGUI_APIboolBeginPopup(constchar*str_id);// return true if popup if opened and start outputting to it. only call EndPopup() if BeginPopup() returned true!
IMGUI_APIboolBeginPopupContextItem(constchar*str_id,intmouse_button=1);// open and begin popup when clicked on last item
IMGUI_APIboolBeginPopupContextWindow(boolalso_over_items=true,constchar*str_id=NULL,intmouse_button=1);// open and begin popup when clicked on current window
IMGUI_APIboolBeginPopupContextVoid(constchar*str_id=NULL,intmouse_button=1);// open and begin popup when clicked in void (no window)
IMGUI_APIvoidEndPopup();
IMGUI_APIvoidEndPopup();
IMGUI_APIvoidCloseCurrentPopup();// close the popup we have begin-ed into. clicking on a MenuItem or Selectable automatically close the current popup.
// Layout
// Cursor / Layout
IMGUI_APIvoidBeginGroup();
IMGUI_APIvoidBeginGroup();// once closing a group it is seen as a single item (so you can use IsItemHovered() on a group, SameLine() between groups, etc.
IMGUI_APIvoidEndGroup();
IMGUI_APIvoidEndGroup();
IMGUI_APIvoidSeparator();// horizontal line
IMGUI_APIvoidSeparator();// horizontal line
IMGUI_APIvoidSameLine(intcolumn_x=0,intspacing_w=-1);// call between widgets or groups to layout them horizontally
IMGUI_APIvoidSameLine(intcolumn_x=0,intspacing_w=-1);// call between widgets or groups to layout them horizontally
IMGUI_APIvoidSpacing();// add vertical spacing
IMGUI_APIvoidSpacing();// add spacing
IMGUI_APIvoidDummy(constImVec2&size);// add a dummy item of given size
IMGUI_APIvoidIndent();// move content position toward the right by style.IndentSpacing pixels
IMGUI_APIvoidIndent();// move content position toward the right by style.IndentSpacing pixels
IMGUI_APIvoidUnindent();// move content position back to the left (cancel Indent)
IMGUI_APIvoidUnindent();// move content position back to the left (cancel Indent)
IMGUI_APIvoidColumns(intcount=1,constchar*id=NULL,boolborder=true);// setup number of columns. use an identifier to distinguish multiple column sets. close with Columns(1).
IMGUI_APIvoidColumns(intcount=1,constchar*id=NULL,boolborder=true);// setup number of columns. use an identifier to distinguish multiple column sets. close with Columns(1).
@ -193,7 +202,8 @@ namespace ImGui
IMGUI_APIvoidSetCursorScreenPos(constImVec2&pos);// cursor position in absolute screen coordinates [0..io.DisplaySize]
IMGUI_APIvoidSetCursorScreenPos(constImVec2&pos);// cursor position in absolute screen coordinates [0..io.DisplaySize]
IMGUI_APIvoidAlignFirstTextHeightToWidgets();// call once if the first item on the line is a Text() item and you want to vertically lower it to match subsequent (bigger) widgets
IMGUI_APIvoidAlignFirstTextHeightToWidgets();// call once if the first item on the line is a Text() item and you want to vertically lower it to match subsequent (bigger) widgets
IMGUI_APIfloatGetTextLineHeight();// height of font == GetWindowFontSize()
IMGUI_APIfloatGetTextLineHeight();// height of font == GetWindowFontSize()
IMGUI_APIfloatGetTextLineHeightWithSpacing();// spacing (in pixels) between 2 consecutive lines of text == GetWindowFontSize() + GetStyle().ItemSpacing.y
IMGUI_APIfloatGetTextLineHeightWithSpacing();// distance (in pixels) between 2 consecutive lines of text == GetWindowFontSize() + GetStyle().ItemSpacing.y
IMGUI_APIfloatGetItemsLineHeightWithSpacing();// distance (in pixels) between 2 consecutive lines of standard height widgets == GetWindowFontSize() + GetStyle().FramePadding.y*2 + GetStyle().ItemSpacing.y
// ID scopes
// ID scopes
// If you are creating widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them
// If you are creating widgets in a loop you most likely want to push a unique identifier so ImGui can differentiate them
@ -212,7 +222,9 @@ namespace ImGui
IMGUI_APIvoidTextV(constchar*fmt,va_listargs);
IMGUI_APIvoidTextV(constchar*fmt,va_listargs);
IMGUI_APIvoidTextColored(constImVec4&col,constchar*fmt,...);// shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();
IMGUI_APIvoidTextColored(constImVec4&col,constchar*fmt,...);// shortcut for PushStyleColor(ImGuiCol_Text, col); Text(fmt, ...); PopStyleColor();
IMGUI_APIvoidTextWrapped(constchar*fmt,...);// shortcut for PushTextWrapPos(0.0f); Text(fmt, ...); PopTextWrapPos();. Note that this won't work on an auto-resizing window if there's no other widgets to extend the window width, yoy may need to set a size using SetNextWindowSize().
IMGUI_APIvoidTextUnformatted(constchar*text,constchar*text_end=NULL);// doesn't require null terminated string if 'text_end' is specified. no copy done to any bounded stack buffer, recommended for long chunks of text
IMGUI_APIvoidTextUnformatted(constchar*text,constchar*text_end=NULL);// doesn't require null terminated string if 'text_end' is specified. no copy done to any bounded stack buffer, recommended for long chunks of text
IMGUI_APIvoidLabelText(constchar*label,constchar*fmt,...);// display text+label aligned the same way as value+label widgets
IMGUI_APIvoidLabelText(constchar*label,constchar*fmt,...);// display text+label aligned the same way as value+label widgets
// Widgets: Sliders (tip: ctrl+click on a slider to input text)
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
// Widgets: Drags (tip: ctrl+click on a drag box to input text)
// Widgets: Drags (tip: ctrl+click on a drag box to input text)
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
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 text)
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_APIboolBeginMenuBar();// append to menu-bar of current window (requires ImGuiWindowFlags_MenuBar flag set). only call EndMenuBar() if this returns true!
IMGUI_APIvoidEndMenuBar();
// Widgets: Value() Helpers. Output single value in "name: value" format (tip: freely declare your own within the ImGui namespace!)
IMGUI_APIboolBeginMenu(constchar*label,boolenabled=true);// create a sub-menu entry. only call EndMenu() if this returns true!
IMGUI_APIvoidEndMenu();
IMGUI_APIboolMenuItem(constchar*label,constchar*shortcut=NULL,boolselected=false,boolenabled=true);// return true when activated. shortcuts are displayed for convenience but not processed by ImGui at the moment
IMGUI_APIboolMenuItem(constchar*label,constchar*shortcut,bool*p_selected,boolenabled=true);// return true when activated + toggle (*p_selected) if p_selected != NULL
// Widgets: Value() Helpers. Output single value in "name: value" format (tip: freely declare more in your code to handle your types. you can add functions to the ImGui namespace)
IMGUI_APIboolIsItemHovered();// was the last item hovered by mouse?
IMGUI_APIboolIsItemHovered();// was the last item hovered by mouse?
IMGUI_APIboolIsItemHoveredRect();// was the last item hovered by mouse? even if another item is active while we are hovering this
IMGUI_APIboolIsItemHoveredRect();// was the last item hovered by mouse? even if another item is active while we are hovering this
IMGUI_APIboolIsItemActive();// was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
IMGUI_APIboolIsItemActive();// was the last item active? (e.g. button being held, text field being edited- items that don't interact will always return false)
IMGUI_APIboolIsAnyItemActive();//
IMGUI_APIboolIsItemVisible();
IMGUI_APIboolIsItemVisible();
IMGUI_APIboolIsAnyItemHovered();
IMGUI_APIboolIsAnyItemActive();
IMGUI_APIImVec2GetItemRectMin();// get bounding rect of last item in screen space
IMGUI_APIImVec2GetItemRectMin();// get bounding rect of last item in screen space
IMGUI_APIImVec2GetItemRectMax();// "
IMGUI_APIImVec2GetItemRectMax();// "
IMGUI_APIImVec2GetItemRectSize();// "
IMGUI_APIImVec2GetItemRectSize();// "
IMGUI_APIboolIsWindowFocused();// is current window focused (differentiate child windows from each others)
IMGUI_APIboolIsWindowFocused();// is current window focused (differentiate child windows from each others)
IMGUI_APIboolIsRootWindowFocused();// is current root window focused
IMGUI_APIboolIsRootWindowFocused();// is current root window focused (top parent window in case of child windows)
IMGUI_APIboolIsRootWindowOrAnyChildFocused();// is current root window or any of its child (including current window) focused
IMGUI_APIboolIsRootWindowOrAnyChildFocused();// is current root window or any of its child (including current window) focused
IMGUI_APIboolIsRectClipped(constImVec2&size);// test if rectangle of given size starting from cursor pos is out of clipping region. to perform coarse clipping on user's side (as an optimization)
IMGUI_APIboolIsRectVisible(constImVec2&size);// test if rectangle of given size starting from cursor pos is visible (not clipped). to perform coarse clipping on user's side (as an optimization)
IMGUI_APIboolIsKeyDown(intkey_index);// key_index into the keys_down[512] array, imgui doesn't know the semantic of each entry
IMGUI_APIboolIsKeyDown(intkey_index);// key_index into the keys_down[512] array, imgui doesn't know the semantic of each entry
IMGUI_APIImVec2CalcItemRectClosestPoint(constImVec2&pos,boolon_edge=false,floatoutward=+0.0f);// utility to find the closest point the last item bounding rectangle edge. useful to visually link items
IMGUI_APIImVec2CalcItemRectClosestPoint(constImVec2&pos,boolon_edge=false,floatoutward=+0.0f);// utility to find the closest point the last item bounding rectangle edge. useful to visually link items
IMGUI_APIvoidCalcListClipping(intitems_count,floatitems_height,int*out_items_display_start,int*out_items_display_end);// helper to manually clip large list of items. see comments in implementation
IMGUI_APIvoidCalcListClipping(intitems_count,floatitems_height,int*out_items_display_start,int*out_items_display_end);// calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can.
IMGUI_APIvoidBeginChildFrame(ImGuiIDid,constImVec2&size);// helper to create a child window / scrolling region that looks like a normal widget frame
IMGUI_APIvoidBeginChildFrame(ImGuiIDid,constImVec2&size);// helper to create a child window / scrolling region that looks like a normal widget frame
// Proxy functions to access the MemAllocFn/MemFreeFn pointers in ImGui::GetIO()
// Helpers functions to access the MemAllocFn/MemFreeFn pointers in ImGui::GetIO()
IMGUI_APIvoid*MemAlloc(size_tsz);
IMGUI_APIvoid*MemAlloc(size_tsz);
IMGUI_APIvoidMemFree(void*ptr);
IMGUI_APIvoidMemFree(void*ptr);
// Internal state access - if you want to share ImGui state between modules (e.g. DLL) or allocate it yourself
// Internal state/context access - if you want to use multiple ImGui context, or share context between modules (e.g. DLL), or allocate the memory yourself