feat(framework): inicializar contexto ImPlot3D en app_base
ImPlot3D::CreateContext() / DestroyContext() acoplado al ciclo de vida de ImPlot. Cualquier app que use fn::run_app obtiene el contexto 3D listo sin codigo extra. Issue 0028.
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include "imgui_impl_glfw.h"
|
#include "imgui_impl_glfw.h"
|
||||||
#include "imgui_impl_opengl3.h"
|
#include "imgui_impl_opengl3.h"
|
||||||
#include "implot.h"
|
#include "implot.h"
|
||||||
|
#include "implot3d.h"
|
||||||
#include "core/tokens.h"
|
#include "core/tokens.h"
|
||||||
#include "core/icon_font.h"
|
#include "core/icon_font.h"
|
||||||
#include "core/app_settings.h"
|
#include "core/app_settings.h"
|
||||||
@@ -51,6 +52,7 @@ int run_app(AppConfig config, std::function<void()> render_fn) {
|
|||||||
IMGUI_CHECKVERSION();
|
IMGUI_CHECKVERSION();
|
||||||
ImGui::CreateContext();
|
ImGui::CreateContext();
|
||||||
ImPlot::CreateContext();
|
ImPlot::CreateContext();
|
||||||
|
ImPlot3D::CreateContext();
|
||||||
|
|
||||||
ImGuiIO& io = ImGui::GetIO();
|
ImGuiIO& io = ImGui::GetIO();
|
||||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
||||||
@@ -163,6 +165,7 @@ int run_app(AppConfig config, std::function<void()> render_fn) {
|
|||||||
// Cleanup
|
// Cleanup
|
||||||
ImGui_ImplOpenGL3_Shutdown();
|
ImGui_ImplOpenGL3_Shutdown();
|
||||||
ImGui_ImplGlfw_Shutdown();
|
ImGui_ImplGlfw_Shutdown();
|
||||||
|
ImPlot3D::DestroyContext();
|
||||||
ImPlot::DestroyContext();
|
ImPlot::DestroyContext();
|
||||||
ImGui::DestroyContext();
|
ImGui::DestroyContext();
|
||||||
glfwDestroyWindow(window);
|
glfwDestroyWindow(window);
|
||||||
|
|||||||
Reference in New Issue
Block a user