|
@@ -131,7 +131,6 @@
|
|
ImGuiIO& io = ImGui::GetIO();
|
|
ImGuiIO& io = ImGui::GetIO();
|
|
io.DisplaySize.x = 1920.0f;
|
|
io.DisplaySize.x = 1920.0f;
|
|
io.DisplaySize.y = 1280.0f;
|
|
io.DisplaySize.y = 1280.0f;
|
|
- io.RenderDrawListsFn = MyRenderFunction; // Setup a render function, or set to NULL and call GetDrawData() after Render() to access render data.
|
|
|
|
// TODO: Fill others settings of the io structure later.
|
|
// TODO: Fill others settings of the io structure later.
|
|
|
|
|
|
// Load texture atlas (there is a default font so you don't need to care about choosing a font yet)
|
|
// Load texture atlas (there is a default font so you don't need to care about choosing a font yet)
|
|
@@ -162,6 +161,7 @@
|
|
|
|
|
|
// Render & swap video buffers
|
|
// Render & swap video buffers
|
|
ImGui::Render();
|
|
ImGui::Render();
|
|
|
|
+ MyImGuiRenderFunction(ImGui::GetDrawData());
|
|
SwapBuffers();
|
|
SwapBuffers();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -250,6 +250,7 @@
|
|
Here is a change-log of API breaking changes, if you are using one of the functions listed, expect to have to fix some code.
|
|
Here is a change-log of API breaking changes, if you are using one of the functions listed, expect to have to fix some code.
|
|
Also read releases logs https://github.com/ocornut/imgui/releases for more details.
|
|
Also read releases logs https://github.com/ocornut/imgui/releases for more details.
|
|
|
|
|
|
|
|
+ - 2018/02/16 (1.60) - obsoleted the io.RenderDrawListsFn callback, you can call your graphics engine render function after ImGui::Render(). Use ImGui::GetDrawData() to retrieve the ImDrawData* to display.
|
|
- 2018/02/07 (1.60) - reorganized context handling to be more explicit,
|
|
- 2018/02/07 (1.60) - reorganized context handling to be more explicit,
|
|
- YOU NOW NEED TO CALL ImGui::CreateContext() AT THE BEGINNING OF YOUR APP, AND CALL ImGui::DestroyContext() AT THE END.
|
|
- YOU NOW NEED TO CALL ImGui::CreateContext() AT THE BEGINNING OF YOUR APP, AND CALL ImGui::DestroyContext() AT THE END.
|
|
- removed Shutdown() function, as DestroyContext() serve this purpose.
|
|
- removed Shutdown() function, as DestroyContext() serve this purpose.
|
|
@@ -882,15 +883,18 @@ ImGuiIO::ImGuiIO()
|
|
OptMacOSXBehaviors = false;
|
|
OptMacOSXBehaviors = false;
|
|
#endif
|
|
#endif
|
|
OptCursorBlink = true;
|
|
OptCursorBlink = true;
|
|
-
|
|
|
|
|
|
+
|
|
// Settings (User Functions)
|
|
// Settings (User Functions)
|
|
- RenderDrawListsFn = NULL;
|
|
|
|
GetClipboardTextFn = GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations
|
|
GetClipboardTextFn = GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations
|
|
SetClipboardTextFn = SetClipboardTextFn_DefaultImpl;
|
|
SetClipboardTextFn = SetClipboardTextFn_DefaultImpl;
|
|
ClipboardUserData = NULL;
|
|
ClipboardUserData = NULL;
|
|
ImeSetInputScreenPosFn = ImeSetInputScreenPosFn_DefaultImpl;
|
|
ImeSetInputScreenPosFn = ImeSetInputScreenPosFn_DefaultImpl;
|
|
ImeWindowHandle = NULL;
|
|
ImeWindowHandle = NULL;
|
|
|
|
|
|
|
|
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
|
|
+ RenderDrawListsFn = NULL;
|
|
|
|
+#endif
|
|
|
|
+
|
|
// Input (NB: we already have memset zero the entire structure)
|
|
// Input (NB: we already have memset zero the entire structure)
|
|
MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
|
|
MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
|
|
MousePosPrev = ImVec2(-FLT_MAX, -FLT_MAX);
|
|
MousePosPrev = ImVec2(-FLT_MAX, -FLT_MAX);
|
|
@@ -2657,7 +2661,7 @@ ImGuiStyle& ImGui::GetStyle()
|
|
return GImGui->Style;
|
|
return GImGui->Style;
|
|
}
|
|
}
|
|
|
|
|
|
-// Same value as passed to your RenderDrawListsFn() function. valid after Render() and until the next call to NewFrame()
|
|
|
|
|
|
+// Same value as passed to the old io.RenderDrawListsFn function. Valid after Render() and until the next call to NewFrame()
|
|
ImDrawData* ImGui::GetDrawData()
|
|
ImDrawData* ImGui::GetDrawData()
|
|
{
|
|
{
|
|
return GImGui->DrawData.Valid ? &GImGui->DrawData : NULL;
|
|
return GImGui->DrawData.Valid ? &GImGui->DrawData : NULL;
|
|
@@ -4079,8 +4083,10 @@ void ImGui::Render()
|
|
g.IO.MetricsRenderIndices = g.DrawData.TotalIdxCount;
|
|
g.IO.MetricsRenderIndices = g.DrawData.TotalIdxCount;
|
|
|
|
|
|
// Render. If user hasn't set a callback then they may retrieve the draw data via GetDrawData()
|
|
// Render. If user hasn't set a callback then they may retrieve the draw data via GetDrawData()
|
|
|
|
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
if (g.DrawData.CmdListsCount > 0 && g.IO.RenderDrawListsFn != NULL)
|
|
if (g.DrawData.CmdListsCount > 0 && g.IO.RenderDrawListsFn != NULL)
|
|
g.IO.RenderDrawListsFn(&g.DrawData);
|
|
g.IO.RenderDrawListsFn(&g.DrawData);
|
|
|
|
+#endif
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|