Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of integrating a GLMakie plot in a CImGui window (or conversely) #114

Open
Benoit9 opened this issue May 11, 2024 · 6 comments
Open

Comments

@Benoit9
Copy link

Benoit9 commented May 11, 2024

I ran across this nice example: https://gist.github.com/SteffenPL/88f65222bf786a6434bc2da3ae02ac74

Unfortunately, both Makie and CimGui have changed since then, and I can't figure out how to adapt the code to the new APIs.

Would there be another example somewhere, or could someone give me some hints?

Thanks a lot!

@JamesWrigley
Copy link
Collaborator

That's the only example I'm aware of I'm afraid 😅 What are the errors you get when you try running it? Note that that example is for embedding ImGui inside GLMakie, there's another discussion here about embedding GLMakie in ImGui: #112

@Benoit9
Copy link
Author

Benoit9 commented May 12, 2024

Well, there are changes to the API that are easily fixed, like using CImGui.GLFWBackend that becomes using CImGui.ImGuiGLFWBackend

But then, a line like:
ImGui_ImplGlfw_InitForOpenGL(GLMakie.to_native(GLMakie.global_gl_screen()), true)
I have no clue what to do with.

I have been told on Discourse to replace

screen = AbstractPlotting.backend_display(GLMakie.GLBackend(), scene)
set_window_config!(renderloop=imgui_renderloop)

with:

new_screen = display(scene, backend = GLMakie)
GLMakie.activate!(; config_kwargs...)

That helps.

GLMakie in Imgui or the other way around would work for me. If there is some WIP, I can try and contribute... Thanks!

@JamesWrigley
Copy link
Collaborator

I see 👍 I don't have the bandwidth to look into it more ATM (though it's on my todo list), but if you don't need Makie specifically you might be interested in ImPlot.jl as an alternative plotting library: https://github.com/wsphillips/ImPlot.jl

@Benoit9
Copy link
Author

Benoit9 commented May 13, 2024

OK, thanks! I I find something I will report back.

@scls19fr
Copy link

Hi, I was looking for something similar ie GLMakie plot inside CImGui window (for my use case). Any news?

@JamesWrigley
Copy link
Collaborator

Not from me unfortunately, though it's still on my todo list 🙈 I think for now ImPlot.jl is probably your best bet for plotting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants