feat: add multi-viewport support and SQLite amalgamation to C++ framework
- AppConfig.viewports flag para ventanas OS reales fuera del main window - Multi-viewport render loop en app_base.cpp (UpdatePlatformWindows) - SQLite amalgamation vendoreada para Windows cross-compile - LANGUAGES C CXX en CMakeLists para compilar sqlite3.c - Fix pie_chart.cpp para nueva API de ImPlot (PlotPieChart sin flags arg) - imgui.ini añadido a gitignore Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -52,8 +52,20 @@ int run_app(AppConfig config, std::function<void()> render_fn) {
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
|
||||
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
||||
|
||||
if (config.viewports) {
|
||||
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable;
|
||||
}
|
||||
|
||||
ImGui::StyleColorsDark();
|
||||
|
||||
// When viewports are enabled, tweak WindowRounding/WindowBg so
|
||||
// platform windows look consistent with the main window
|
||||
if (config.viewports) {
|
||||
ImGuiStyle& style = ImGui::GetStyle();
|
||||
style.WindowRounding = 0.0f;
|
||||
style.Colors[ImGuiCol_WindowBg].w = 1.0f;
|
||||
}
|
||||
|
||||
ImGui_ImplGlfw_InitForOpenGL(window, true);
|
||||
ImGui_ImplOpenGL3_Init("#version 330");
|
||||
|
||||
@@ -80,6 +92,14 @@ int run_app(AppConfig config, std::function<void()> render_fn) {
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
|
||||
|
||||
// Multi-viewport: update and render platform windows
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable) {
|
||||
GLFWwindow* backup_ctx = glfwGetCurrentContext();
|
||||
ImGui::UpdatePlatformWindows();
|
||||
ImGui::RenderPlatformWindowsDefault();
|
||||
glfwMakeContextCurrent(backup_ctx);
|
||||
}
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
|
||||
#ifdef TRACY_ENABLE
|
||||
|
||||
Reference in New Issue
Block a user