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

Restore OS X support for GLX as an option #63

Closed
dbevans opened this issue Jul 19, 2015 · 3 comments
Closed

Restore OS X support for GLX as an option #63

dbevans opened this issue Jul 19, 2015 · 3 comments

Comments

@dbevans
Copy link

dbevans commented Jul 19, 2015

As the principal maintainer of the GNOME ports for MacPorts, I'd like to indicate my extreme disappointment with your decision to drop GLX support for OS X in version 3.0. X11 on OS X and GLX in particular (using mesa) is alive and well in MacPorts and is required, in general, to fully support GNOME due to the spotty support for OS X in the GNOME applications. I'd like to suggest that you restore this support but make it optional for those who don't wish to take advantage of it. In particular, this effects the use of the GLArea widget in GTK+ 3 using X11 which is based, as you know, on your library.

Thanks for your consideration.

@anholt
Copy link
Owner

anholt commented Jul 20, 2015

Yeah, it sucks, but just as many people were saying they couldn't use the library because the build depends were to onerous. At this point I don't even have a Mac to test on, though, so I can't do much. What I'd love to see as a solution is a header included in the library that is just enough to generate the couple of calls we need, without needing libX11 at build time.

@dbevans
Copy link
Author

dbevans commented Jul 20, 2015

Well, that's why I say make it optional. Then everyone can 'have it their way'.

The focus of MacPorts is to make Linux/Unix software available on the Mac, and many of these require X11 of course. So, for instance, we give people the option to build GTK+ with either X11 or the native Quartz environment where it can be supported. We currently support GTK+ 3.16.5 with either X11 or Quartz backends and are testing 3.17.4.

Concerning X11 dependencies, if you only need libX11 itself then that really is a small footprint compared to what most X11 apps use.

At any rate, if you are willing to have an open mind, I would be glad to take a crack making X11 a build option for OS X and submitting it to you for review, or to help test any code that you would like to see
tested on OS X. I'm thinking it may just be sufficient to fool your library into thinking we are Linux rather than OS X if an X11 build is desired. But I haven't really taken a detailed look at your 3.1 version as yet.

@jeremyhu
Copy link

The version in MacPorts doesn't work with mesa/X11 currently. I was looking into this today, and part of the problem is that epoxy_get_bootstrap_proc_address calls epoxy_gl_dlsym() instead of epoxy_glx_dlsym() for the GLX API support.

void *
epoxy_gl_dlsym(const char *name)
{
#ifdef _WIN32
    return do_dlsym(&api.gl_handle, "OPENGL32", name, true);
#elif defined(__APPLE__)
    return do_dlsym(&api.gl_handle,
                    "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL",
                    name, true);
#else
    /* There's no library for desktop GL support independent of GLX. */
    return epoxy_glx_dlsym(name);
#endif
}
...
void *
epoxy_get_bootstrap_proc_address(const char *name)
{
    /* If we already have a library that links to libglapi loaded,
     * use that.
     */
#if PLATFORM_HAS_GLX
    if (api.glx_handle && glXGetCurrentContext())
        return epoxy_gl_dlsym(name);
#endif

Plus additional assumptions in epoxy_get_proc_address and throughout dispatch_common.c. Win32 also has the same problem. We shouldn't be making compile-time assumptions about what GL context type we're using.

jeremyhu added a commit to jeremyhu/libepoxy that referenced this issue Jan 18, 2016
Also makes a stab at similar support for Win32

anholt#63

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
@ebassi ebassi closed this as completed in ec93dcd Feb 6, 2017
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