LiangliangNan / Easy3D

A lightweight, easy-to-use, and efficient C++ library for processing and rendering 3D data
GNU General Public License v3.0
1.35k stars 243 forks source link

[BUG] - imgui not working in v2.5.3 on Windows #178

Closed paolostefan closed 6 months ago

paolostefan commented 6 months ago

On Windows/MSVC v143 the 2.5.3 release's imgui tutorial (202) is broken, that is, the imgui widgets won't show up.

How to reproduce the bug

Clone the repo tag 2.5.3.

mkdir build
cd build
cmake ..
cmake --build . --config Release -- /m
cd bin\Release
.\Tutorial_202_Viewer_imgui.exe

Expected behavior: the viewer window should feature an ImGui menu. Actual behavior: there is no visible menu.

Development/Running environment:

Additional context

The problem seems to be related to the GLFW library. The "initialized" field of _glfw, which is true after calling ViewerImGui::init(), is reset to false right after the ImGui_ImplGlfw_NewFrame(). This causes the GLFW library to return {0.0, 0.0} as window dimensions, thus making ImGui create a clipping rect of zero width for the menu, which becomes invisible.

LiangliangNan commented 6 months ago

Hi, thanks for letting me know about this issue. It was due to that the internal glfw (initialized in another DLL, for Windows) won't be shared across DLL boundaries. Now it has been fixed. Let me know if it still doesn't work on your machine.

paolostefan commented 6 months ago

Great, it's working now. Thank you very much!