pthom / imgui_bundle

Your fast track to powerful GUIs: Dear ImGui Bundle, an extensive toolkit for Python and C++ with immediate mode efficiency.
https://pthom.github.io/imgui_bundle/
MIT License
703 stars 73 forks source link

nanovg without hello_imgui #259

Open Yves33 opened 1 month ago

Yves33 commented 1 month ago

Hello, Is there a way to use nanovg with pure python backends (glfw)? (it works for imnodes and implot) It seems that the functions required to setup contexts are missing from the bindings.

nvgCreateGL2()
nvgCreateGL3()
nvgSetupGL2()
nvgSetupGL3()
pthom commented 1 month ago

Hello,

It will not be possible to access nanovg from a pure python backend.

After a long investigation, I found that any call to openGL functions will fail on the C++ side since no OpenGL loader was initialized on this side (OpenGL and glfw ared only initialized on the Python side).

Getting this to work would require

I tried it, it failed, and I later gave up, since this is getting way tricky.

Yves33 commented 1 month ago

Thanks for investigating. I'll investigate using python_nanovg bindings from scratch. Great job anyway!

Edit:
I was able to use nanovg in combination with imgui_bundle in a pure glfw backend using bindings from https://github.com/inniyah/nanovg
Which raises the following questions/suggestions: