Draw GL canvas in Dear ImGui

I have been struggling to draw a canvas in part of an X window.
Ultimately it would be nice to put a canvas somewhere in a Dear ImGui display. The typical user interactions are not needed. I would just like to draw in part of the window.

It is not clear if the old-style opengl in root is the problem. (I am not an opengl expert).

Here is what the base window looks like:

Here is my attempt to draw the canvas in a smaller corner in the upper right part of the screen.

I am guessing root has always assumed it was drawing on the entire window.

Is it impossible to draw a canvas in only part if the window?

Thanks.

EDIT: Since the thread was closed (and cannot be reopened?)

I was hoping there would be an easy way to use ROOT’s GL painters but I am afraid this is impossible. From my experience with root it appears that a whole new “painter” needs to be implemented for ImGui. This is probably desirable since the whole interaction model of “retained mode” would not easily carry over to “immediate mode” (where interactions are much easier).

Here is a test project that I was playing with a bit ago. The screenshots show a crude attempt to draw a histogram using the imgui api (blue histogram).

It would be a lot of work to translate all the ROOT painters to imgui. I am not sure what the best path forward is for ROOT.

hmmmm … note sur how to test/reproduce this. … I guess you have no standalone ROOT macro simulating this effect ?

I am still working on it. Seems like there is an annoying combination of old versions of open gl, window display management, graphics drivers… I’ll keep you updated if I get anywhere.

Ok thanks. Let us know.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.