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

X11::GLX as possible OpenGL::GLX support #62

Open
devel-chm opened this issue Jul 2, 2017 · 5 comments
Open

X11::GLX as possible OpenGL::GLX support #62

devel-chm opened this issue Jul 2, 2017 · 5 comments

Comments

@devel-chm
Copy link
Collaborator

@nrdvana has recently released his X11::GLX module providing the GLX to OpenGL glue needed for X11 programming. He has also released X11::Xlib this spring for more general X11 programming. I was able to build X11:Xlib on cygwin/win7 but there were test failures for X11::GLX. If those problems can be resolved, this module could be the basis for the desired OpenGL::GLX functionality from OpenGL to make it (and more!) available for OpenGL::Modern users.

https://github.com/nrdvana/perl-X11-GLX
https://metacpan.org/pod/X11::GLX

@nrdvana
Copy link
Collaborator

nrdvana commented Jul 3, 2017

I'd be happy to assist adding any API you need in the X11::GLX module.

But also, in my recent experience working with Xlib, I've learned that it's really a mess, and that building on xcb (the new C bindings for X11) would be preferred. However, all the glX functions require a "Display*" and this is specific to Xlib. xcb uses "xcb_connection*" for its connections. If anyone knows a way to make GLX functions operate directly on xcb, I'd be interested to know.

@mohawk2
Copy link
Contributor

mohawk2 commented Sep 16, 2024

Does GLX really bring any capability that is worth making an effort to create a binding for?

@nrdvana
Copy link
Collaborator

nrdvana commented Sep 16, 2024

GLX is the only way to do a few fancy things, like transparent windows that don't intercept mouse input, or server-side rendering where multiple applications can share the GL resource IDs.

If you know your app will only ever run on X11, it's also the lightest weight option for setting up OpenGL, such as for the DeLorean dashboard.

The binding is already written, but I'm not sure what @devel-chm had in mind for tying it into OpenGL::Modern.

In the long run, I'll probably need to rewrite my stuff for Wayland anyway.

@mohawk2
Copy link
Contributor

mohawk2 commented Sep 16, 2024

My feeling therefore is that it might be useful to detect and offer bindings for GLX within this thing if found, but not at the cost of lots of effort? EDIT - does that make sense to you?

@nrdvana
Copy link
Collaborator

nrdvana commented Sep 16, 2024

My thought would be that anyone who wants to use X11 + GLX directly probably ought to install the modules directly. In order for OpenGL::Modern to export the GLX symbols on its own, you'd either be exposing all the X11 integer IDs with no way for the user to manipulate them, or need to copy a large amount of auxillary code from X11::Xlib and X11::GLX, or have OpenGL::Modern load X11::Xlib and X11::GLX and then re-export symbols that came from those modules. I'm not sure how much convenience the third case would provide.

Now, if there is something in OpenGL::Modern (or which @devel-chm was planning to add to OpenGL::Modern) where you just want to set up the easiest GL context with whatever is available, then I think it makes a lot of sense to test for whether X11::GLX is installed and use it as one of the options. I do this in OpenGL::Sandbox make_context

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

No branches or pull requests

3 participants