Skip to content

Problem: Linux glfw drawing #11

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

Open
kanryu opened this issue Mar 17, 2024 · 0 comments
Open

Problem: Linux glfw drawing #11

kanryu opened this issue Mar 17, 2024 · 0 comments

Comments

@kanryu
Copy link
Owner

kanryu commented Mar 17, 2024

Please show me your wisdom.

When using mado with glfw layer, there is a problem on both x11 and wayland on Linux. The two problems are different.

x11

  • Window frames and title bars are visible.
  • Can operate window
  • OpenGL drawing is not done.
  • OpenGL API does not output error code

want to solve

  • OpenGL rendering become visible

wayland

  • Window borders and title bars are not displayed
  • Unable to operate window
  • OpenGL drawing is performed

want to solve

  • Display window frame

wayland in mado mode

  • Window frame is displayed
  • At this time, looking at os_wayland.go and egl_wayland.go, it appears that the window frame is being drawn by itself.
  • I would like to know how to draw a Window frame in the Window Manager in a wayland environment because this behavior is inappropriate when providing OpenGL drawing with complete freedom to the user like glfw.

wayland behavior in ubuntu-22.04.3

wl_registry_add_listener() does'nt callback zxdg_decoration_manager_v1.

This object is necessary for mado (gioui) to request the Window Manager to draw the application's own window frame, but initialization fails because the object is not provided by the OS. In the end, the application's window frame is not drawn.

I tested at home what specific wayland objects are provided by Ubuntu, but I can't write them here because I can't enter the environment right now. I'll write it here when I get home.

This library may help

gl never renders

Since then, I have spent many days almost completely porting the setup code for the x11 environment using glfw's EGL, but I still haven't been able to confirm OpenGL rendering in x11. There is a large amount of x11 source code left behind by glfw, and it is difficult to determine which code is interfering with OpenGL initialization, so for x11/egl, it is better to port initialization code other than glfw. Maybe.

I discovered a perfect product called glmark2. It has a complete initialization routine that support both of OpenGL/ES with EGL, and overall seems much simpler than glfw. I like that it also supports Android rendering. I'm planning to try porting from glmark2 starting tomorrow.

https://github.com/glmark2/glmark2

glad

Finally, I found a good example. :)

https://github.com/kanryu/glad

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

1 participant