mxwendler
mxwendler
Ok, thank you for the explanantion. > What should be doable is to add another method that takes a python integer (PyLong) as input and convert it to a void...
Thanks for the quick test! This is what it did: ``` auto main_module = PyImport_ImportModule("__main__"); auto main_dict = PyModule_GetDict(main_module); ImGuiContext* prev_ctx = ImGui::GetCurrentContext(); auto i_obj = PyLong_FromVoidPtr(prev_ctx); PyDict_SetItemString(main_dict, "i", i_obj);...
half-success by now, after the init sequence: `[DEBUG] Add a new context...` which looks good, then later in the drawing loop ``` ImGui_ImplDX9_NewFrame(); ImGui_ImplWin32_NewFrame(); ImGui::NewFrame(); ImGui::Begin("Hello, world!"); PyRun_SimpleString("imgui.button(\"x\")"); ``` crashes:...
Unfortunately no change, still crash with same syptoms. actually i set the context myself already: Py_Initialize(); auto main_module = PyImport_ImportModule("__main__"); auto main_dict = PyModule_GetDict(main_module); ImGuiContext* prev_ctx = ImGui::GetCurrentContext(); auto i_obj...
> I will have to setup a cpp project that embed python with pyimgui locally to be able to debug it properly. If it helps, this is the diff to...
Actually all that should be needed is a correct imgui context. I mean, this is the very definition of a context. Maybe there is some struct packing (different offsets etc)...
> EDIT: I also checked that the context pointer used inside pyimgui imgui.text() call corresponds to the cpp one and it is indeed the case... can you validate the pointer...
To create debug symbols in a cython .pyd, edit the setup.py (and copy the pdb next to the .pyd. just a hack.) ``` if sys.platform in ('cygwin', 'win32') and not...
Now for the real problem, i issued long l = sizeof(ImGuiContext); two times, once in the main.cpp and once inside the pyimgui core.cpp, and the results were different. main.cpp: 23928...
> So basically, if I understood properly, it is a simple problem of version matching between pyimgui and the Dear ImGui included in the cpp project? Exactly. > For the...