@ -29,13 +29,14 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- window/opt: freeze window flag: if not focused/hovered, return false, render with previous ImDrawList. and/or reduce refresh rate. -> this may require enforcing that it is illegal to submit contents if Begin returns false.
- window/opt: freeze window flag: if not focused/hovered, return false, render with previous ImDrawList. and/or reduce refresh rate. -> this may require enforcing that it is illegal to submit contents if Begin returns false.
- window/child: the first draw command of a child window could be moved into the current draw command of the parent window (unless child+tooltip?).
- window/child: the first draw command of a child window could be moved into the current draw command of the parent window (unless child+tooltip?).
- window/clipping: some form of clipping when DisplaySize (or corresponding viewport) is zero.
- window/clipping: some form of clipping when DisplaySize (or corresponding viewport) is zero.
- window/tab: add a way to signify that a window or docked window requires attention (e.g. blinking title bar).
- scrolling: while holding down a scrollbar, try to keep the same contents visible (at least while not moving mouse)
- scrolling: while holding down a scrollbar, try to keep the same contents visible (at least while not moving mouse)
- scrolling: allow immediately effective change of scroll after Begin() if we haven't appended items yet.
- scrolling: allow immediately effective change of scroll after Begin() if we haven't appended items yet.
- scrolling/clipping: separator on the initial position of a window is not visible (cursorpos.y <= clippos.y). (2017-08-20: can't repro)
- scrolling/clipping: separator on the initial position of a window is not visible (cursorpos.y <= clippos.y). (2017-08-20: can't repro)
- scrolling/style: shadows on scrollable areas to denote that there is more contents
- scrolling/style: shadows on scrollable areas to denote that there is more contents
- drawdata: make it easy to clone (or swap?) a ImDrawData so user can easily save that data if they use threaded rendering.
- drawdata: make it easy to clone (or swap?) a ImDrawData so user can easily save that data if they use threaded rendering.
- drawlist: add calctextsize func to facilitate consistent code from user pov
! drawlist: add calctextsize func to facilitate consistent code from user pov (currently need to use ImGui or ImFont alternatives!)
- drawlist: end-user probably can't call Clear() directly because we expect a texture to be pushed in the stack.
- drawlist: end-user probably can't call Clear() directly because we expect a texture to be pushed in the stack.
- drawlist: maintaining bounding box per command would allow to merge draw command when clipping isn't relied on (typical non-scrolling window or non-overflowing column would merge with previous command).
- drawlist: maintaining bounding box per command would allow to merge draw command when clipping isn't relied on (typical non-scrolling window or non-overflowing column would merge with previous command).
- drawlist: primitives/helpers to manipulate vertices post submission, so e.g. a quad/rect can be resized to fit later submitted content, _without_ using the ChannelSplit api
- drawlist: primitives/helpers to manipulate vertices post submission, so e.g. a quad/rect can be resized to fit later submitted content, _without_ using the ChannelSplit api
@ -45,6 +46,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- drawlist: rendering: provide a way for imgui to output to a single/global vertex buffer, re-order indices only at the end of the frame (ref: https://gist.github.com/floooh/10388a0afbe08fce9e617d8aefa7d302)
- drawlist: rendering: provide a way for imgui to output to a single/global vertex buffer, re-order indices only at the end of the frame (ref: https://gist.github.com/floooh/10388a0afbe08fce9e617d8aefa7d302)
- drawlist: callback: add an extra void* in ImDrawCallback to allow passing render-local data to the callback (would break API).
- drawlist: callback: add an extra void* in ImDrawCallback to allow passing render-local data to the callback (would break API).
- drawlist: AddRect vs AddLine position confusing (#2441)
- drawlist: AddRect vs AddLine position confusing (#2441)
- drawlist: channel splitter should be external helper and not stored in ImDrawList.
- drawlist/opt: store rounded corners in texture to use 1 quad per corner (filled and wireframe) to lower the cost of rounding. (#1962)
- drawlist/opt: store rounded corners in texture to use 1 quad per corner (filled and wireframe) to lower the cost of rounding. (#1962)
- drawlist/opt: AddRect() axis aligned pixel aligned (no-aa) could use 8 triangles instead of 16 and no normal calculation.
- drawlist/opt: AddRect() axis aligned pixel aligned (no-aa) could use 8 triangles instead of 16 and no normal calculation.
- drawlist/opt: thick AA line could be doable in same number of triangles as 1.0 AA line by storing gradient+full color in atlas.
- drawlist/opt: thick AA line could be doable in same number of triangles as 1.0 AA line by storing gradient+full color in atlas.
@ -372,6 +374,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- examples: glfw: could go idle when minimized? if (glfwGetWindowAttrib(window, GLFW_ICONIFIED)) { glfwWaitEvents(); continue; } // issue: DeltaTime will be super high on resume, perhaps provide a way to let impl know (#440)
- examples: glfw: could go idle when minimized? if (glfwGetWindowAttrib(window, GLFW_ICONIFIED)) { glfwWaitEvents(); continue; } // issue: DeltaTime will be super high on resume, perhaps provide a way to let impl know (#440)
- examples: opengl: rename imgui_impl_opengl2 to impl_opengl_legacy and imgui_impl_opengl3 to imgui_impl_opengl? (#1900)
- examples: opengl: rename imgui_impl_opengl2 to impl_opengl_legacy and imgui_impl_opengl3 to imgui_impl_opengl? (#1900)
- examples: opengl: could use a single vertex buffer and glBufferSubData for uploads?
- examples: opengl: could use a single vertex buffer and glBufferSubData for uploads?
- examples: opengl: explicitly disable GL_STENCIL_TEST in bindings.
- examples: vulkan: viewport: support for synchronized swapping of multiple swap chains.
- examples: vulkan: viewport: support for synchronized swapping of multiple swap chains.
- optimization: replace vsnprintf with stb_printf? or enable the defines/infrastructure to allow it (#1038)
- optimization: replace vsnprintf with stb_printf? or enable the defines/infrastructure to allow it (#1038)
- optimization: add clipping for multi-component widgets (SliderFloatX, ColorEditX, etc.). one problem is that nav branch can't easily clip parent group when there is a move request.
- optimization: add clipping for multi-component widgets (SliderFloatX, ColorEditX, etc.). one problem is that nav branch can't easily clip parent group when there is a move request.
// As a default initial behavior, pop up an alert when webgl context is lost. To make your
return canvas;
// application robust, you may want to override this behavior before shipping!
// See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
return canvas;
})(),
})(),
setStatus: function(text) {
setStatus: function(text) {
if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' };
console.log("status: " + text);
if (text === Module.setStatus.last.text) return;
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
var now = Date.now();
if (m && now - Module.setStatus.last.time <30)return;//ifthisisaprogressupdate,skipitiftoosoon
// Calculate default item width given value passed to PushItemWidth() or SetNextItemWidth(),
// Then consume the
floatImGui::GetNextItemWidth()
{
{
ImGuiWindow*window=GetCurrentWindowRead();
ImGuiWindow*window=GImGui->CurrentWindow;
floatw=window->DC.ItemWidth;
floatw;
if(window->DC.NextItemWidth!=FLT_MAX)
{
w=window->DC.NextItemWidth;
window->DC.NextItemWidth=FLT_MAX;
}
else
{
w=window->DC.ItemWidth;
}
if(w<0.0f)
if(w<0.0f)
{
{
// Align to a right-side limit. We include 1 frame padding in the calculation because this is how the width is always used (we add 2 frame padding to it), but we could move that responsibility to the widget as well.
IMGUI_APIImVec2GetWindowSize();// get current window size
IMGUI_APIImVec2GetWindowSize();// get current window size
IMGUI_APIfloatGetWindowWidth();// get current window width (shortcut for GetWindowSize().x)
IMGUI_APIfloatGetWindowWidth();// get current window width (shortcut for GetWindowSize().x)
IMGUI_APIfloatGetWindowHeight();// get current window height (shortcut for GetWindowSize().y)
IMGUI_APIfloatGetWindowHeight();// get current window height (shortcut for GetWindowSize().y)
IMGUI_APIImVec2GetContentRegionMax();// current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates
IMGUI_APIImVec2GetWindowContentRegionMin();// content boundaries min (roughly (0,0)-Scroll), in window coordinates
IMGUI_APIImVec2GetWindowContentRegionMax();// content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates
IMGUI_APIfloatGetWindowContentRegionWidth();//
// Prefer using SetNextXXX functions (before Begin) rather that SetXXX functions (after Begin).
IMGUI_APIvoidSetNextWindowPos(constImVec2&pos,ImGuiCondcond=0,constImVec2&pivot=ImVec2(0,0));// set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc.
IMGUI_APIvoidSetNextWindowPos(constImVec2&pos,ImGuiCondcond=0,constImVec2&pivot=ImVec2(0,0));// set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc.
IMGUI_APIvoidSetNextWindowSize(constImVec2&size,ImGuiCondcond=0);// set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()
IMGUI_APIvoidSetNextWindowSize(constImVec2&size,ImGuiCondcond=0);// set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()
IMGUI_APIvoidSetNextWindowSizeConstraints(constImVec2&size_min,constImVec2&size_max,ImGuiSizeCallbackcustom_callback=NULL,void*custom_callback_data=NULL);// set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Use callback to apply non-trivial programmatic constraints.
IMGUI_APIvoidSetNextWindowSizeConstraints(constImVec2&size_min,constImVec2&size_max,ImGuiSizeCallbackcustom_callback=NULL,void*custom_callback_data=NULL);// set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Use callback to apply non-trivial programmatic constraints.
@ -301,6 +296,15 @@ namespace ImGui
IMGUI_APIvoidSetWindowCollapsed(constchar*name,boolcollapsed,ImGuiCondcond=0);// set named window collapsed state
IMGUI_APIvoidSetWindowCollapsed(constchar*name,boolcollapsed,ImGuiCondcond=0);// set named window collapsed state
IMGUI_APIvoidSetWindowFocus(constchar*name);// set named window to be focused / front-most. use NULL to remove focus.
IMGUI_APIvoidSetWindowFocus(constchar*name);// set named window to be focused / front-most. use NULL to remove focus.
// Content region
// - Those functions are bound to be redesigned soon (they are confusing, incomplete and return values in local window coordinates which increases confusion)
IMGUI_APIImVec2GetContentRegionMax();// current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates
IMGUI_APIImVec2GetWindowContentRegionMin();// content boundaries min (roughly (0,0)-Scroll), in window coordinates
IMGUI_APIImVec2GetWindowContentRegionMax();// content boundaries max (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates
IMGUI_APIfloatGetWindowContentRegionWidth();//
// Windows Scrolling
// Windows Scrolling
IMGUI_APIfloatGetScrollX();// get scrolling amount [0..GetScrollMaxX()]
IMGUI_APIfloatGetScrollX();// get scrolling amount [0..GetScrollMaxX()]
IMGUI_APIfloatGetScrollY();// get scrolling amount [0..GetScrollMaxY()]
IMGUI_APIfloatGetScrollY();// get scrolling amount [0..GetScrollMaxY()]
@ -329,8 +333,9 @@ namespace ImGui
IMGUI_APIImU32GetColorU32(ImU32col);// retrieve given color with style alpha applied
IMGUI_APIImU32GetColorU32(ImU32col);// retrieve given color with style alpha applied
// Parameters stacks (current window)
// 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)
IMGUI_APIvoidPushItemWidth(floatitem_width);// set width of items for common large "item+label" widgets. >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). 0.0f = default to ~2/3 of windows width,
IMGUI_APIvoidPopItemWidth();
IMGUI_APIvoidPopItemWidth();
IMGUI_APIvoidSetNextItemWidth(floatitem_width);// set width of the _next_ common large "item+label" widget. >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)
IMGUI_APIfloatCalcItemWidth();// width of item given pushed settings and current cursor position
IMGUI_APIfloatCalcItemWidth();// width of item given pushed settings and current cursor position
IMGUI_APIvoidPushTextWrapPos(floatwrap_local_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_local_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();
@ -343,7 +348,7 @@ namespace ImGui
// - By "cursor" we mean the current output position.
// - By "cursor" we mean the current output position.
// - The typical widget behavior is to output themselves at the current cursor position, then move the cursor one line down.
// - The typical widget behavior is to output themselves at the current cursor position, then move the cursor one line down.
IMGUI_APIvoidSeparator();// separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.
IMGUI_APIvoidSeparator();// separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.
IMGUI_APIvoidSameLine(floatlocal_pos_x =0.0f,floatspacing_w=-1.0f);// call between widgets or groups to layout them horizontally. X position given in window coordinates.
IMGUI_APIvoidSameLine(floatoffset_from_start_x=0.0f,floatspacing=-1.0f);// call between widgets or groups to layout them horizontally. X position given in window coordinates.
IMGUI_APIvoidNewLine();// undo a SameLine() or force a new line when in an horizontal-layout context.
IMGUI_APIvoidNewLine();// undo a SameLine() or force a new line when in an horizontal-layout context.
IMGUI_APIvoidSpacing();// add vertical spacing.
IMGUI_APIvoidSpacing();// add vertical spacing.
IMGUI_APIvoidDummy(constImVec2&size);// add a dummy item of given size. unlike InvisibleButton(), Dummy() won't take the mouse click or be navigable into.
IMGUI_APIvoidDummy(constImVec2&size);// add a dummy item of given size. unlike InvisibleButton(), Dummy() won't take the mouse click or be navigable into.
constchar*TypeName;// Short description stored in .ini file. Disallowed characters: '[' ']'
constchar*TypeName;// Short description stored in .ini file. Disallowed characters: '[' ']'
ImGuiIDTypeHash;// == ImHashStr(TypeName, 0, 0)
ImGuiIDTypeHash;// == ImHashStr(TypeName)
void*(*ReadOpenFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,constchar*name);// Read: Called when entering into a new ini entry e.g. "[Window][Name]"
void*(*ReadOpenFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,constchar*name);// Read: Called when entering into a new ini entry e.g. "[Window][Name]"
void(*ReadLineFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,void*entry,constchar*line);// Read: Called for every line of text within an ini entry
void(*ReadLineFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,void*entry,constchar*line);// Read: Called for every line of text within an ini entry
void(*WriteAllFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,ImGuiTextBuffer*out_buf);// Write: Output every entries into 'out_buf'
void(*WriteAllFn)(ImGuiContext*ctx,ImGuiSettingsHandler*handler,ImGuiTextBuffer*out_buf);// Write: Output every entries into 'out_buf'
// We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings.
// We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings.
IMGUI_APIboolIsItemToggledSelection();// was the last item selection toggled? (after Selectable(), TreeNode() etc. We only returns toggle _event_ in order to handle clipping correctly)
IMGUI_APIboolIsItemToggledSelection();// was the last item selection toggled? (after Selectable(), TreeNode() etc. We only returns toggle _event_ in order to handle clipping correctly)
IMGUI_APIImVec2GetContentRegionMaxScreen();
// Logging/Capture
// Logging/Capture
IMGUI_APIvoidLogBegin(ImGuiLogTypetype,intauto_open_depth);// -> BeginCapture() when we design v2 api, for now stay under the radar by using the old name.
IMGUI_APIvoidLogBegin(ImGuiLogTypetype,intauto_open_depth);// -> BeginCapture() when we design v2 api, for now stay under the radar by using the old name.
ImVec2size=CalcItemSize(size_arg,CalcItemWidth(),(is_multiline?GetTextLineHeight()*8.0f:label_size.y)+style.FramePadding.y*2.0f);// Arbitrary default of 8 lines high for multi-line
ImVec2size=CalcItemSize(size_arg,GetNextItemWidth(),(is_multiline?GetTextLineHeight()*8.0f:label_size.y)+style.FramePadding.y*2.0f);// Arbitrary default of 8 lines high for multi-line