NewFrame() now asserts if neither Render or EndFrame have been called. Exposed EndFrame(). Made it legal to call EndFrame() more than one. (#1423 etc.)
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)");
IM_ASSERT((g.FrameCount==0||g.FrameCountEnded==g.FrameCount)&&"Forgot to call Render() or EndFrame() at the end of the previous frame?");
// Initialize on first frame
if(!g.Initialized)
@ -2743,7 +2744,8 @@ void ImGui::EndFrame()
{
ImGuiContext&g=*GImGui;
IM_ASSERT(g.Initialized);// Forgot to call ImGui::NewFrame()
IM_ASSERT(g.FrameCountEnded!=g.FrameCount);// ImGui::EndFrame() called multiple times, or forgot to call ImGui::NewFrame() again
if(g.FrameCountEnded==g.FrameCount)// Don't process EndFrame() multiple times.
return;
// Notify OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME)
IMGUI_APIImDrawData*GetDrawData();// same value as passed to your io.RenderDrawListsFn() function. valid after Render() and until the next call to NewFrame()
IMGUI_APIvoidNewFrame();// start a new ImGui frame, you can submit any command from this point until NewFrame()/Render().
IMGUI_APIvoidRender();// ends the ImGui frame, finalize rendering data, then call your io.RenderDrawListsFn() function if set.
IMGUI_APIvoidNewFrame();// start a new ImGui frame, you can submit any command from this point until Render()/EndFrame().
IMGUI_APIvoidRender();// ends the ImGui frame, finalize the draw data, then call your io.RenderDrawListsFn() function if set.
IMGUI_APIvoidEndFrame();// ends the ImGui frame. automatically called by Render(), so most likely don't need to ever call that yourself directly. If you don't need to render you may call EndFrame() but you'll have wasted CPU already. If you don't need to render, better to not create any imgui windows instead!
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!