Open csuckow opened 10 months ago
Hello,
Integrating ImGui TestEngine directly from python, and without using HelloImGui and ImmApp is very difficult.
ImGui Test Engine uses two different threads (one for the main gui, and one for the scenario runner). Your python code will be called from two separate threads, and this breaks the GIL!
HelloImGui and ImmApp handle this well by transferring the GIL between threads (from C++). Doing this from pure python seems difficult.
I ran into this too, #166. Two thoughts:
imgui.test_engine.create_context()
and imgui.test_engine.start()
?runner_params.use_imgui_test_engine
can only be set before the start of the app. Can you make it such that on each iteration your display functions check if its true, and if its true but there is not test engine context yet, make, register and start it?Regarding the second: just an idea, no idea 1. how needed it is, 2. how useful it is.
Can you document this, perhaps in the docs that come up for imgui.test_engine.create_context() and imgui.test_engine.start()?
Yes, see https://github.com/pthom/imgui_bundle/commit/20eecc036b6e6e5d3affd2058feae46bd2ef0d63
If i understand correctly, runner_params.use_imgui_test_engine can only be set before the start of the app. Can you make it such that on each iteration your display functions check if its true, and if its true but there is not test engine context yet, make, register and start it?
I see no real use case for this.
However, I added the possibility to call register_test several times during the app lifetime.
https://github.com/pthom/imgui_bundle/commit/745ded62dc889a2f11a9c36f798fcea3643b8e88
Ok, thanks for those additions!
So the logic would be that, until the patch upstream is in, you'd have to decide whether the test engine should be started or not before run()ing the app. I have not seen any performance issue connected to this, so guess its ok.
The patch is already upstream
Ah super! Nice work!
Hello! I am tinkering with the recent example for glfw and trying to integrate the test_engine by following the instructions here and here. I was trying to click the button from the example window via test engine, but ran into some difficulties. When calling
imgui.test_engine.start
, the application freezes. Is there something obvious that I'm missing?