File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ static const Uint32 SDL_WINDOW_VULKAN = 0x10000000;
138138extern " C" {
139139
140140bool ImGui_ImplSDL2_InitForOpenGL (SDL_Window* window, void * sdl_gl_context);
141+ bool ImGui_ImplSDL2_InitForOther (SDL_Window* window);
141142void ImGui_ImplSDL2_Shutdown ();
142143void ImGui_ImplSDL2_NewFrame ();
143144bool ImGui_ImplSDL2_ProcessEvent (const SDL_Event* event);
Original file line number Diff line number Diff line change 11const gui = @import ("gui.zig" );
22
3+ pub fn init (
4+ window : * const anyopaque , // SDL_Window
5+ ) void {
6+ if (! ImGui_ImplSDL2_InitForOther (window )) {
7+ unreachable ;
8+ }
9+ }
10+
311pub fn initOpenGL (
412 window : * const anyopaque , // SDL_Window
513 context : * const anyopaque , // SDL_GL_Context
@@ -24,6 +32,7 @@ pub fn newFrame() void {
2432}
2533
2634// These functions are defined in `imgui_impl_sdl2.cpp`
35+ extern fn ImGui_ImplSDL2_InitForOther (window : * const anyopaque ) bool ;
2736extern fn ImGui_ImplSDL2_InitForOpenGL (window : * const anyopaque , sdl_gl_context : * const anyopaque ) bool ;
2837extern fn ImGui_ImplSDL2_ProcessEvent (event : * const anyopaque ) bool ;
2938extern fn ImGui_ImplSDL2_NewFrame () void ;
You can’t perform that action at this time.
0 commit comments