io.MousePos=ImVec2((float)mx,(float)my);// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
else
io.MousePos=ImVec2(-1,-1);
io.MousePos=ImVec2(-FLT_MAX,-FLT_MAX);
io.MouseDown[0]=g_MousePressed[0]||(mouseMask&SDL_BUTTON(SDL_BUTTON_LEFT))!=0;// If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.
io.MousePos=ImVec2((float)mx,(float)my);// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
else
io.MousePos=ImVec2(-1,-1);
io.MousePos=ImVec2(-FLT_MAX,-FLT_MAX);
io.MouseDown[0]=g_MousePressed[0]||(mouseMask&SDL_BUTTON(SDL_BUTTON_LEFT))!=0;// If a mouse press event came, always pass it as "mouse held this frame", so we don't miss click-release events that are shorter than 1 frame.
IM_ASSERT(g.Style.Alpha>=0.0f&&g.Style.Alpha<=1.0f);// Invalid style setting. Alpha cannot be negative (allows us to avoid a few clamps in color computations)
if((g.IO.MousePos.x<0&&g.IO.MousePos.y<0)||(g.IO.MousePosPrev.x<0&&g.IO.MousePosPrev.y<0))// if mouse just appeared or disappeared (negative coordinate) we cancel out movement in MouseDelta
g.IO.MouseDelta=ImVec2(0.0f,0.0f);
else
// If mouse just appeared or disappeared (usually denoted by -FLT_MAX component, but in reality we test for -256000.0f) we cancel out movement in MouseDelta
IMGUI_APIvoidNextColumn();// next column, defaults to current row or next row if the current row is finished
IMGUI_APIintGetColumnIndex();// get current column index
IMGUI_APIfloatGetColumnWidth(intcolumn_index=-1);// get column width (in pixels). pass -1 to use current column
IMGUI_APIvoidSetColumnWidth(intcolumn_index,floatwidth);// set column width (in pixels). pass -1 to use current column
IMGUI_APIfloatGetColumnOffset(intcolumn_index=-1);// get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetColumnsCount() inclusive. column 0 is typically 0.0f
IMGUI_APIvoidSetColumnOffset(intcolumn_index,floatoffset_x);// set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column
IMGUI_APIvoidNextColumn();// next column, defaults to current row or next row if the current row is finished
IMGUI_APIintGetColumnIndex();// get current column index
IMGUI_APIfloatGetColumnWidth(intcolumn_index=-1);// get column width (in pixels). pass -1 to use current column
IMGUI_APIvoidSetColumnWidth(intcolumn_index,floatwidth);// set column width (in pixels). pass -1 to use current column
IMGUI_APIfloatGetColumnOffset(intcolumn_index=-1);// get position of column line (in pixels, from the left side of the contents region). pass -1 to use current column, otherwise 0..GetColumnsCount() inclusive. column 0 is typically 0.0f
IMGUI_APIvoidSetColumnOffset(intcolumn_index,floatoffset_x);// set position of column line (in pixels, from the left side of the contents region). pass -1 to use current column
IMGUI_APIintGetColumnsCount();
// 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 (e.g. object pointer, loop index) so ImGui can differentiate them.
// You can also use the "##foobar" syntax within widget label to distinguish them from each others. Read "A primer on the use of labels/IDs" in the FAQ for more details.
IMGUI_APIvoidPushID(constchar*str_id);// push identifier into the ID stack. IDs are hash of the *entire* stack!
IMGUI_APIvoidPushID(constchar*str_id);// push identifier into the ID stack. IDs are hash of the entire stack!
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_APIImGuiIDGetID(constchar*str_id);// calculate unique ID (hash of whole ID stack + given parameter). e.g. if you want to query into ImGuiStorage yourself
IMGUI_APIvoidTextWrapped(constchar*fmt,...)IM_PRINTFARGS(1);// 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_APIvoidLabelText(constchar*label,constchar*fmt,...)IM_PRINTFARGS(2);// display text+label aligned the same way as value+label widgets
IMGUI_APIvoidBullet();// draw a small circle and keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses
IMGUI_APIvoidBulletText(constchar*fmt,...)IM_PRINTFARGS(1);// shortcut for Bullet()+Text()
IMGUI_APIvoidTextUnformatted(constchar*text,constchar*text_end=NULL);// doesn't require null terminated string if 'text_end' is specified. no copy done, no limits, recommended for long chunks of text
IMGUI_APIvoidText(constchar*fmt,...)IM_FMTARGS(1);// simple formatted text
IMGUI_APIvoidTextWrapped(constchar*fmt,...)IM_FMTARGS(1);// 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_APIvoidBullet();// draw a small circle and keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses
IMGUI_APIboolImageButton(ImTextureIDuser_texture_id,constImVec2&size,constImVec2&uv0=ImVec2(0,0),constImVec2&uv1=ImVec2(1,1),intframe_padding=-1,constImVec4&bg_col=ImVec4(0,0,0,0),constImVec4&tint_col=ImVec4(1,1,1,1));// <0 frame_padding uses default frame padding settings. 0 for no padding
@ -337,15 +341,15 @@ namespace ImGui
// 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().
IMGUI_APIboolTreeNode(constchar*str_id,constchar*fmt,...)IM_FMTARGS(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().
IMGUI_APIvoidTreePush(constchar*str_id=NULL);// ~ Indent()+PushId(). Already called by TreeNode() when returning true, but you can call Push/Pop yourself for layout purpose
IMGUI_APIvoidSetTooltip(constchar*fmt,...)IM_PRINTFARGS(1);// set text tooltip under mouse-cursor, typically use with ImGui::IsItemHovered(). overidde any previous call to SetTooltip().
IMGUI_APIvoidSetTooltip(constchar*fmt,...)IM_FMTARGS(1);// set text tooltip under mouse-cursor, typically use with ImGui::IsItemHovered(). overidde any previous call to SetTooltip().
IMGUI_APIboolIsMouseReleased(intbutton);// did mouse button released (went from Down to !Down)
IMGUI_APIboolIsMouseDragging(intbutton=0,floatlock_threshold=-1.0f);// is mouse dragging. if lock_threshold < -1.0f uses io.MouseDraggingThreshold
IMGUI_APIboolIsMouseHoveringRect(constImVec2&r_min,constImVec2&r_max,boolclip=true);// is mouse hovering given bounding rect (in screen space). clipped by current clipping settings. disregarding of consideration of focus/window ordering/blocked by a popup.
ImVec2MousePos;// Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.)
ImVec2MousePos;// Mouse position, in pixels. Set to ImVec2(-FLT_MAX,-FLT_MAX) if mouse is unavailable (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).
boolFontDataOwnedByAtlas;// true // TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself). Set to true
boolFontDataOwnedByAtlas;// true // TTF/OTF data ownership taken by the container ImFontAtlas (will delete memory itself).
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.
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.
ImVec2GlyphOffset;// 0, 0 // Offset all glyphs from this font input
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.
ImVec2GlyphOffset;// 0, 0 // Offset all glyphs from this font input.
constImWchar*GlyphRanges;// NULL // 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). You may want to use GlyphOffset.y when merge font of different heights.
unsignedintRasterizerFlags;// 0x00 // Settings for custom font rasterizer (e.g. ImGuiFreeType). Leave as zero if you aren't using one.
floatRasterizerMultiply;// 1.0f // Brighten (>1.0f) or darken (<1.0f) font output. Brightening small fonts may be a good workaround to make them more readable.
// We are keeping those not leaking to the user by default, in the case the user has implicit cast operators between ImVec2 and its own types (when IM_VEC2_CLASS_EXTRA is defined)
IMGUI_APIvoidEndFrame();// Ends the ImGui frame. Automatically called by Render()! you most likely don't need to ever call that yourself directly. If you don't need to render you can call EndFrame() but you'll have wasted CPU already. If you don't need to render, don't create any windows instead!