QML.jl icon indicating copy to clipboard operation
QML.jl copied to clipboard

Support latest Makie / GLMakie

Open rasmushenningsson opened this issue 2 years ago • 15 comments

Currently, QML.jl works well with GLMakie.jl v0.6 (and Makie.jl v0.17). But not with the latest versions - GLMakie.jl v0.8 (and Makie.jl v0.19).

The error message is "GLScreen not defined". Hopefully, this is a rather small fix if you're familiar with the setup, but I'm not certain.

Later, it would also be nice to use the new Package Extensions rather than Requires.jl for Makie support - which among other things makes it possible to put compat bounds for Makie/GLMakie.

rasmushenningsson avatar Sep 28 '23 11:09 rasmushenningsson

Very good suggestions! Makie.jl is hard to support because it is still a rapidly moving target.

ufechner7 avatar Sep 28 '23 17:09 ufechner7

The plan is to move the Makie support into a separate package. I don't think it's a simple fix to upgrade. Having a separate package will allow us to formally set compat bounds also, currently the limits set in the examples repository are the valid ones.

barche avatar Sep 28 '23 22:09 barche

As first step we could investigate the errors that happen if we use Makie 0.18 ...

ufechner7 avatar Oct 02 '23 16:10 ufechner7

Just to add a data point, and in case anyone was wondering, the Makie 0.20 beta which has some breaking changes, still suffers from this same error. @SimonDanisch FYI.

pbouffard avatar Nov 13 '23 21:11 pbouffard

I looked into this ages ago, though unfortunately my discussions with @barche about it are lost to the Slack-hole. As far as I remember, the major blocker is that Makie support depends on QMLScreen subtyping GLMakie.GLScreen: https://github.com/JuliaGraphics/QML.jl/blob/main/src/makie_support.jl#L51

And in Makie 0.18 (or 0.19, my memory is fuzzy) support for the abstract GLMakie.GLScreen was dropped in favour of a concrete Screen type that all methods now require: https://github.com/MakieOrg/Makie.jl/blob/master/GLMakie/src/screen.jl#L159

To add support for more recent versions I think Makie would have to add back support for that abstract type.

JamesWrigley avatar Feb 19 '24 15:02 JamesWrigley

@JamesWrigley also mentioned on slack that there is a Google Summer Of Code project for this: https://julialang.org/jsoc/gsoc/gui/#qml_and_makie_integration

rasmushenningsson avatar Feb 22 '24 11:02 rasmushenningsson

Also see QML Roadmap with discussion here: https://github.com/orgs/JuliaGraphics/discussions/4

rasmushenningsson avatar Apr 23 '24 18:04 rasmushenningsson

@JamesWrigley also mentioned on slack that there is a Google Summer Of Code project for this: https://julialang.org/jsoc/gsoc/gui/#qml_and_makie_integration

The 2024 GSOC projects have been announced (https://julialang.org/blog/2024/05/gsoc-2024-fellows/), but QML and Makie integration is not included in the list.

Does this mean that there is no planned work on this at the moment?

rasmushenningsson avatar May 21 '24 14:05 rasmushenningsson

Indeed, I don't think there is any planned work on this at the moment. Please correct me if I am wrong.

ufechner7 avatar May 21 '24 16:05 ufechner7

We had no viable GSOC proposals for this topic, but it is still pretty high on my todo list for QML.jl. I can’t give a timeline though.

barche avatar May 23 '24 06:05 barche

I'm happy to hear that it's still something you want to do! I completely understand that it's not easy to find the time.

rasmushenningsson avatar May 23 '24 07:05 rasmushenningsson

I looked into this ages ago, though unfortunately my discussions with @barche about it are lost to the Slack-hole. As far as I remember, the major blocker is that Makie support depends on QMLScreen subtyping GLMakie.GLScreen: https://github.com/JuliaGraphics/QML.jl/blob/main/src/makie_support.jl#L51

And in Makie 0.18 (or 0.19, my memory is fuzzy) support for the abstract GLMakie.GLScreen was dropped in favour of a concrete Screen type that all methods now require: https://github.com/MakieOrg/Makie.jl/blob/master/GLMakie/src/screen.jl#L159

To add support for more recent versions I think Makie would have to add back support for that abstract type.

I've spent the last few days integrating Makie with CImGui so I understand things a bit better now :sweat_smile:

If I read the code correctly QML.jl currently creates its own Screen and rendering functions, but I think with Makie's current design the integration will be simpler because we only need to worry about the OpenGL window bits (the QML window in this case) and forwarding input (mouse buttons etc) from the window, no need to reimplement the rendering code or anything. What stopped me from re-using more of GLMakie than I currently do is GLMakie assuming that it owns Screen.glscreen and trying to do things like resizing the window or setting window hints. I'd like to make a PR to GLMakie at some point to indicate whether or not the Screen owns the window, and that should make integration even simpler.

JamesWrigley avatar Jul 29 '24 13:07 JamesWrigley

I'd like to make a PR to GLMakie at some point to indicate whether or not the Screen owns the window, and that should make integration even simpler.

Done: https://github.com/MakieOrg/Makie.jl/pull/4073 If anyone wants to get started on fixing the Makie integration in QML.jl, I outlined the basic steps that are necessary in the new docs in the PR.

JamesWrigley avatar Jul 30 '24 23:07 JamesWrigley

Great, thanks a lot for this, this looks like it will make integrating Makie support a lot easier and cleaner!

barche avatar Jul 31 '24 12:07 barche