mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Merge branch 'master' into master
This commit is contained in:
Vendored
+13
-8
@@ -3734,7 +3734,7 @@ ImGuiKeyModFlags ImGui::GetMergedKeyModFlags()
|
||||
return key_mod_flags;
|
||||
}
|
||||
|
||||
void ImGui::NewFrame()
|
||||
void ImGui::NewFrame(bool clearCmdList)
|
||||
{
|
||||
IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?");
|
||||
ImGuiContext& g = *GImGui;
|
||||
@@ -3777,16 +3777,21 @@ void ImGui::NewFrame()
|
||||
if (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset)
|
||||
g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AllowVtxOffset;
|
||||
|
||||
g.BackgroundDrawList.ResetForNewFrame();
|
||||
g.BackgroundDrawList.PushTextureID(g.IO.Fonts->TexID);
|
||||
g.BackgroundDrawList.PushClipRectFullScreen();
|
||||
|
||||
g.ForegroundDrawList.ResetForNewFrame();
|
||||
g.ForegroundDrawList.PushTextureID(g.IO.Fonts->TexID);
|
||||
g.ForegroundDrawList.PushClipRectFullScreen();
|
||||
|
||||
// Mark rendering data as invalid to prevent user who may have a handle on it to use it.
|
||||
g.DrawData.Clear();
|
||||
if (clearCmdList) {
|
||||
g.BackgroundDrawList.ResetForNewFrame();
|
||||
g.BackgroundDrawList.PushClipRectFullScreen();
|
||||
|
||||
g.ForegroundDrawList.ResetForNewFrame();
|
||||
g.ForegroundDrawList.PushClipRectFullScreen();
|
||||
|
||||
g.DrawData.Clear();
|
||||
}
|
||||
|
||||
g.BackgroundDrawList.PushTextureID(g.IO.Fonts->TexID);
|
||||
g.ForegroundDrawList.PushTextureID(g.IO.Fonts->TexID);
|
||||
|
||||
// Drag and drop keep the source ID alive so even if the source disappear our state is consistent
|
||||
if (g.DragDropActive && g.DragDropPayload.SourceId == g.ActiveId)
|
||||
|
||||
Vendored
+3
-1
@@ -246,7 +246,9 @@ namespace ImGui
|
||||
// Main
|
||||
IMGUI_API ImGuiIO& GetIO(); // access the IO structure (mouse/keyboard/gamepad inputs, time, various configuration options/flags)
|
||||
IMGUI_API ImGuiStyle& GetStyle(); // access the Style structure (colors, sizes). Always use PushStyleCol(), PushStyleVar() to modify style mid-frame!
|
||||
IMGUI_API void NewFrame(); // start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame().
|
||||
// jmarshall - added bool clearCmdList
|
||||
IMGUI_API void NewFrame(bool clearCmdList = true); // start a new Dear ImGui frame, you can submit any command from this point until Render()/EndFrame().
|
||||
// jmarshall end
|
||||
IMGUI_API void EndFrame(); // ends the Dear ImGui frame. automatically called by Render(). If you don't need to render data (skipping rendering) you may call EndFrame() without Render()... but you'll have wasted CPU already! If you don't need to render, better to not create any windows and not call NewFrame() at all!
|
||||
IMGUI_API void Render(); // ends the Dear ImGui frame, finalize the draw data. You can get call GetDrawData() to obtain it and run your rendering function (up to v1.60, this used to call io.RenderDrawListsFn(). Nowadays, we allow and prefer calling your render function yourself.)
|
||||
IMGUI_API ImDrawData* GetDrawData(); // valid after Render() and until the next call to NewFrame(). this is what you have to render.
|
||||
|
||||
Reference in New Issue
Block a user