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 Windows binaries of the demo app here.
// In this binding, ImTextureID is used to store an OpenGL 'GLuint' texture identifier. Read the FAQ about ImTextureID in imgui.cpp.
// If your context is GL3/GL3 then prefer using the code in opengl3_example.
// You *might* use this code with a GL3/GL4 context but make sure you disable the programmable pipeline by calling "glUseProgram(0)" before ImGui::Render().
// We cannot do that from GL2 code because the function doesn't exist.
// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
// If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown().
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
// In this binding, ImTextureID is used to store an OpenGL 'GLuint' texture identifier. Read the FAQ about ImTextureID in imgui.cpp.
// If your context is GL3/GL3 then prefer using the code in opengl3_example.
// You *might* use this code with a GL3/GL4 context but make sure you disable the programmable pipeline by calling "glUseProgram(0)" before ImGui::Render().
// We cannot do that from GL2 code because the function doesn't exist.
// You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this.
// If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown().
// If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp.
// Check that draw_list doesn't use more vertices than indexable (default ImDrawIdx = 2 bytes = 64K vertices)
// If this assert triggers because you are drawing lots of stuff manually, A) workaround by calling BeginChild()/EndChild() to put your draw commands in multiple draw lists, B) #define ImDrawIdx to a 'unsigned int' in imconfig.h and render accordingly.
IM_ASSERT((int)draw_list->_VtxCurrentIdx==draw_list->VtxBuffer.Size);// Sanity check. Bug or mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc.
IM_ASSERT((int64_t)draw_list->_VtxCurrentIdx<=((int64_t)1L<<(sizeof(ImDrawIdx)*8)));// Too many vertices in same ImDrawList. See comment above.
// Lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.)
IMGUI_APIvoidBeginGroup();// lock horizontal starting position. 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_APIvoidSeparator();// horizontal line
IMGUI_APIvoidSameLine(floatpos_x=0.0f,floatspacing_w=-1.0f);// call between widgets or groups to layout them horizontally
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_APIvoidUnindent();// move content position back to the left (cancel Indent)
IMGUI_APIvoidBeginGroup();// lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.)
IMGUI_APIvoidEndGroup();
IMGUI_APIImVec2GetCursorPos();// cursor position is relative to window position
IMGUI_APIfloatGetCursorPosX();// "
IMGUI_APIfloatGetCursorPosY();// "
@ -369,6 +369,10 @@ namespace ImGui
IMGUI_APIvoidLogButtons();// helper to display buttons for logging to tty/file/clipboard
IMGUI_APIvoidLogText(constchar*fmt,...)IM_PRINTFARGS(1);// pass text data straight to log (without being displayed)
IMGUI_APIboolIsItemHovered();// was the last item hovered by mouse?
IMGUI_APIboolIsItemHoveredRect();// was the last item hovered by mouse? even if another item is active or window is blocked by popup while we are hovering this
@ -712,7 +716,7 @@ struct ImGuiIO
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
// 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
IMGUI_APIvoidPushClipRect(constImVec4&clip_rect);// Scissoring. Note that the values are (x1,y1,x2,y2) and NOT (x1,y1,w,h). This is passed down to your render function but not used for CPU-side clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
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)
// ImFontAtlas automatically loads a default embedded font for you when you call GetTexDataAsAlpha8() or GetTexDataAsRGBA32().
structImFont
{
// Members: Settings
floatFontSize;// <user set> // Height of characters, set during loading (don't change after loading)
floatScale;// = 1.0f // Base font scale, multiplied by the per-window font scale which you can adjust with SetFontScale()
ImVec2DisplayOffset;// = (0.0f,1.0f) // Offset font rendering by xx pixels
ImWcharFallbackChar;// = '?' // Replacement glyph if one isn't found. Only set via SetFallbackChar()
ImFontConfig*ConfigData;// // Pointer within ImFontAtlas->ConfigData
intConfigDataCount;//
// Members: Runtime data
structGlyph
{
ImWcharCodepoint;
@ -1305,29 +1302,44 @@ struct ImFont
floatX0,Y0,X1,Y1;
floatU0,V0,U1,V1;// Texture coordinates
};
floatAscent,Descent;// Ascent: distance from top to bottom of e.g. 'A' [0..FontSize]
ImFontAtlas*ContainerAtlas;// What we has been loaded into
ImVector<Glyph>Glyphs;
// 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<short>IndexLookup;// // Sparse. Index glyphs by Unicode code-point.
ImVector<float>IndexXAdvance;// Sparse. Glyphs->XAdvance directly indexable (more cache-friendly that reading from Glyphs, for CalcTextSize functions which are often bottleneck in large UI)
ImVector<int>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.
draw_list->PushClipRect(ImVec4(canvas_pos.x,canvas_pos.y,canvas_pos.x+canvas_size.x,canvas_pos.y+canvas_size.y));// clip lines within the canvas (if we resize it, etc.)
draw_list->PushClipRect(canvas_pos,ImVec2(canvas_pos.x+canvas_size.x,canvas_pos.y+canvas_size.y));// clip lines within the canvas (if we resize it, etc.)
// Scissoring. The values in clip_rect are x1, y1, x2, y2. Only apply to rendering! Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
// 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)
IM_ASSERT(font->ContainerAtlas->TexID==_TextureIdStack.back());// Use high-level ImGui::PushFont() or low-level ImDrawList::PushTextureId() to change font.
// reserve vertices for worse case (over-reserving is useful and easily amortized)
IM_ASSERT(IndexLookup.Size>0);// Currently this can only be called AFTER the font has been built, aka after calling ImFontAtlas::GetTexDataAs*() function.
// 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.