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

changes to GLMakie to get drawing into a GtkGLArea working #2418

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

jwahlstrand
Copy link
Contributor

Description

I'm working with @SimonDanisch to get GLMakie to draw into a Gtk4 window. This branch has a couple of changes that I had to make to GLMakie to get a plot to appear.

  1. GLFW threw an error when calling set_parameters() on a Texture while setting up a framebuffer:
ERROR: GLFWError (NO_CURRENT_CONTEXT): Cannot query extension without a current OpenGL or OpenGL ES context

Here I just added a try/catch to ignore that error. There's probably a more correct approach.

  1. GtkGLArea doesn't use 0 for its default framebuffer ID. I learned about this here:
    https://stackoverflow.com/questions/62422683/framebuffer-issue-render-to-texture-with-gtk3-glarea-vs-glfw-identical-opengl

In to_screen_postprocessor(), I added an argument that lets you set default_ID. The default is 0, so GLMakie works fine, but in my code I've hard coded this to 2, which works on my laptop. It would be better to query this number at the beginning of rendering. I suspect if we try to have multiple windows this will become important.

Type of change

  • New feature (non-breaking change which adds functionality)

- ignore a certain GLFW error when calling set_parameters() on a Texture
- in postprocessing, optionally call glBindFramebuffer with a non-zero ID
@SimonDanisch SimonDanisch marked this pull request as ready for review November 17, 2022 09:29
@SimonDanisch SimonDanisch merged commit a5bf51d into MakieOrg:master Nov 17, 2022
t-bltg pushed a commit to t-bltg/Makie.jl that referenced this pull request Dec 31, 2022
…2418)

- ignore a certain GLFW error when calling set_parameters() on a Texture
- in postprocessing, optionally call glBindFramebuffer with a non-zero ID
@jwahlstrand jwahlstrand deleted the forgtk branch September 4, 2023 12:19
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

Successfully merging this pull request may close these issues.

None yet

2 participants