Files
ghostty-org--ghostty/pkg/dcimgui/ext.cpp
T
wehub-resource-sync bd44b5aa08
Nix / Required Checks: Nix (push) Blocked by required conditions
Nix / check-zig-cache-hash (push) Waiting to run
Test / skip (push) Waiting to run
Test / Required Checks: Test (push) Blocked by required conditions
Test / build-bench (push) Blocked by required conditions
Test / list-examples (push) Blocked by required conditions
Test / Example ${{ matrix.dir }} (Windows) (push) Blocked by required conditions
Test / Example ${{ matrix.dir }} (push) Blocked by required conditions
Test / build-cmake (push) Blocked by required conditions
Test / test-lib-vt-pkgconfig (push) Blocked by required conditions
Test / build-flatpak (push) Blocked by required conditions
Test / build-snap (push) Blocked by required conditions
Test / build-linux (namespace-profile-ghostty-md-arm64) (push) Blocked by required conditions
Test / build-nix (namespace-profile-ghostty-md) (push) Blocked by required conditions
Test / build-libghostty-vt (aarch64-linux) (push) Blocked by required conditions
Test / build-libghostty-vt (aarch64-macos) (push) Blocked by required conditions
Test / build-libghostty-vt (wasm32-freestanding) (push) Blocked by required conditions
Test / build-libghostty-vt (x86_64-linux) (push) Blocked by required conditions
Test / build-libghostty-vt (x86_64-linux-musl) (push) Blocked by required conditions
Test / build-libghostty-vt (x86_64-macos) (push) Blocked by required conditions
Test / build-libghostty-vt (x86_64-windows-gnu) (push) Blocked by required conditions
Test / build-libghostty-vt-macos (aarch64-ios) (push) Blocked by required conditions
Test / build-libghostty-vt-macos (aarch64-macos) (push) Blocked by required conditions
Test / build-libghostty-vt-macos (x86_64-macos) (push) Blocked by required conditions
Test / build-libghostty-vt-android (aarch64-linux-android) (push) Blocked by required conditions
Test / build-libghostty-vt-android (arm-linux-androideabi) (push) Blocked by required conditions
Test / build-libghostty-vt-android (x86_64-linux-android) (push) Blocked by required conditions
Test / build-libghostty-vt-windows (push) Blocked by required conditions
Test / build-libghostty-windows-gnu (push) Blocked by required conditions
Test / build-linux (namespace-profile-ghostty-md) (push) Blocked by required conditions
Test / build-linux-libghostty (push) Blocked by required conditions
Test / build-nix (namespace-profile-ghostty-md-arm64) (push) Blocked by required conditions
Test / build-dist (push) Blocked by required conditions
Test / build-dist-lib-vt (push) Blocked by required conditions
Test / trigger-snap (push) Blocked by required conditions
Test / trigger-flatpak (push) Blocked by required conditions
Test / build-macos (push) Blocked by required conditions
Test / build-macos-freetype (push) Blocked by required conditions
Test / test (push) Blocked by required conditions
Test / test-lib-vt (push) Blocked by required conditions
Test / GTK x11=false wayland=false (push) Blocked by required conditions
Test / GTK x11=true wayland=false (push) Blocked by required conditions
Test / GTK x11=false wayland=true (push) Blocked by required conditions
Test / GTK x11=true wayland=true (push) Blocked by required conditions
Test / Build -Dsimd=false (push) Blocked by required conditions
Test / Build -Dsimd=true (push) Blocked by required conditions
Test / Build -Dsentry=false (push) Blocked by required conditions
Test / Build -Dsentry=true (push) Blocked by required conditions
Test / test-macos (push) Blocked by required conditions
Test / test-windows (push) Blocked by required conditions
Test / Build -Di18n=false (push) Blocked by required conditions
Test / Build -Di18n=true (push) Blocked by required conditions
Test / Build test/fuzz-libghostty (push) Blocked by required conditions
Test / zig-fmt (push) Blocked by required conditions
Test / GitHub Actions Pins (push) Blocked by required conditions
Test / prettier (push) Blocked by required conditions
Test / swiftlint (push) Blocked by required conditions
Test / alejandra (push) Blocked by required conditions
Test / typos (push) Blocked by required conditions
Test / shellcheck (push) Blocked by required conditions
Test / translations (push) Blocked by required conditions
Test / blueprint-compiler (push) Blocked by required conditions
Test / Test pkg/wuffs (push) Blocked by required conditions
Test / Test build on Debian 13 (push) Blocked by required conditions
Test / valgrind (push) Blocked by required conditions
chore: import upstream snapshot with attribution
2026-07-13 12:02:48 +08:00

54 lines
2.0 KiB
C++

#include "imgui.h"
// This file contains custom extensions for functionality that isn't
// properly supported by Dear Bindings yet. Namely:
// https://github.com/dearimgui/dear_bindings/issues/55
// Wrap this in a namespace to keep it separate from the C++ API
namespace cimgui
{
#include "dcimgui.h"
}
extern "C"
{
CIMGUI_API void ImFontConfig_ImFontConfig(cimgui::ImFontConfig* self)
{
static_assert(sizeof(cimgui::ImFontConfig) == sizeof(::ImFontConfig), "ImFontConfig size mismatch");
static_assert(alignof(cimgui::ImFontConfig) == alignof(::ImFontConfig), "ImFontConfig alignment mismatch");
::ImFontConfig defaults;
*reinterpret_cast<::ImFontConfig*>(self) = defaults;
}
CIMGUI_API void ImGuiStyle_ImGuiStyle(cimgui::ImGuiStyle* self)
{
static_assert(sizeof(cimgui::ImGuiStyle) == sizeof(::ImGuiStyle), "ImGuiStyle size mismatch");
static_assert(alignof(cimgui::ImGuiStyle) == alignof(::ImGuiStyle), "ImGuiStyle alignment mismatch");
::ImGuiStyle defaults;
*reinterpret_cast<::ImGuiStyle*>(self) = defaults;
}
// Perform the OpenGL3 backend shutdown and then zero out the imgl3w
// function pointer table. ImGui_ImplOpenGL3_Shutdown() calls
// imgl3wShutdown() which dlcloses the GL library handles but does not
// zero out the function pointers. A subsequent ImGui_ImplOpenGL3_Init()
// sees the stale (non-null) pointers, skips loader re-initialization,
// and crashes when calling through them. Zeroing the table forces the
// next Init to reload the GL function pointers via imgl3wInit().
#ifndef IMGUI_DISABLE
#if __has_include("backends/imgui_impl_opengl3.h")
#ifdef ZIGPKG_IMGUI_ENABLE_OPENGL3
#include "backends/imgui_impl_opengl3.h"
#include "backends/imgui_impl_opengl3_loader.h"
CIMGUI_API void ImGui_ImplOpenGL3_ShutdownWithLoaderCleanup()
{
::ImGui_ImplOpenGL3_Shutdown();
memset(&imgl3wProcs, 0, sizeof(imgl3wProcs));
}
#endif // ZIGPKG_IMGUI_ENABLE_OPENGL3
#endif // __has_include("backends/imgui_impl_opengl3.h")
#endif // IMGUI_DISABLE
}