Closed Namek closed 4 months ago
My custom cimgui.h:
#ifndef __IMGUI_ZIG__H
#define __IMGUI_ZIG__H
// without this ifndef it would error about redefining it
#ifndef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
#define CIMGUI_DEFINE_ENUMS_AND_STRUCTS 1
#endif
#include "./cimgui/cimgui.h"
// because Zig doesn't support c.igGetCurrentWindow().*.DC.CursorPosPrevLine;
EXTERN ImGuiWindowTempData* igGetCurrentWindowRead_DC();
EXTERN ImGuiID igDockBuilderGetNodeID(ImGuiID node_id);
#endif
I tried including the original cimgui.h by doing the path change like this:
dep_sokol.artifact("sokol_clib").addIncludePath(b.path("deps/cimgui"));
so it would get the deps/cimgui/cimgui.h
. The error stays the same.
It seems the error is about this place:
static ImDrawList* _simgui_imdrawlist_at(ImDrawData* draw_data, int cl_index) {
#if defined(__cplusplus)
return draw_data->CmdLists[cl_index];
#else
return draw_data->CmdLists.Data[cl_index]; // <!--- this line
#endif
}
This was a breaking change between cimgui 1.89 and 1.90, you basically need to update to a more recent ImGui version to use the sokol imgui bindings:
PS: or rather the breakage seems to have been introduced in cimgui 1.89.9, not in 1.90
Hi!
I have added sokol-zig to my project per this url in build.zig.zon: git+https://github.com/floooh/sokol-zig.git#ca76d1e66b2539a6614535aaad39d0168985a2e9
and then of course my build.zig:
And here I got some C++ error:
Any ideas what's wrong?
My (c)imgui is "1.89.7"