Remove BR2_DEPRECATED
[buildroot-gz.git] / package / libepoxy / 0004-darwin-use-glx-instead-of-opengl-framework.patch
blobbe9b009f5cb2bcd050a6c7cbde011c30bb195a83
1 From d010922282580a32dfebcda12ee1c307b3ef6005 Mon Sep 17 00:00:00 2001
2 From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
3 Date: Mon, 18 Jan 2016 09:49:55 -0800
4 Subject: [PATCH 4/4] darwin: Use GLX instead of OpenGL.framework if it is the
5 current context
7 Also makes a stab at similar support for Win32
9 anholt/libepoxy#63
11 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
12 Fetched from pull #81 on github for libepoxy:
13 https://github.com/anholt/libepoxy/pull/81/commits
14 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
15 ---
16 src/dispatch_common.c | 29 ++++++++++++++++-------------
17 1 file changed, 16 insertions(+), 13 deletions(-)
19 diff --git a/src/dispatch_common.c b/src/dispatch_common.c
20 index 163d348..cb9f76a 100644
21 --- a/src/dispatch_common.c
22 +++ b/src/dispatch_common.c
23 @@ -482,16 +482,20 @@ epoxy_glx_dlsym(const char *name)
24 void *
25 epoxy_gl_dlsym(const char *name)
27 -#ifdef _WIN32
28 +#if defined(_WIN32) || defined(__APPLE__)
29 +if (!epoxy_current_context_is_glx()) {
30 +# if defined(_WIN32)
31 return do_dlsym(&api.gl_handle, "OPENGL32", name, true);
32 -#elif defined(__APPLE__)
33 +# elif defined(__APPLE__)
34 return do_dlsym(&api.gl_handle,
35 "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL",
36 name, true);
37 -#else
38 +# endif
40 +#endif
42 /* There's no library for desktop GL support independent of GLX. */
43 return epoxy_glx_dlsym(name);
44 -#endif
47 void *
48 @@ -615,7 +619,7 @@ epoxy_get_bootstrap_proc_address(const char *name)
50 #if PLATFORM_HAS_GLX
51 if (api.glx_handle && glXGetCurrentContext())
52 - return epoxy_gl_dlsym(name);
53 + return epoxy_glx_dlsym(name);
54 #endif
56 /* If epoxy hasn't loaded any API-specific library yet, try to
57 @@ -644,22 +648,17 @@ epoxy_get_bootstrap_proc_address(const char *name)
59 #endif /* PLATFORM_HAS_EGL */
61 - /* Fall back to GLX */
62 + /* Fall back to the platform default */
63 return epoxy_gl_dlsym(name);
66 void *
67 epoxy_get_proc_address(const char *name)
69 -#ifdef _WIN32
70 - return wglGetProcAddress(name);
71 -#elif defined(__APPLE__)
72 - return epoxy_gl_dlsym(name);
73 -#else
74 #if PLATFORM_HAS_GLX
75 if (epoxy_current_context_is_glx()) {
76 return glXGetProcAddressARB((const GLubyte *)name);
77 - } else
78 + }
79 #endif /* PLATFORM_HAS_GLX */
80 #if PLATFORM_HAS_EGL
82 @@ -674,8 +673,12 @@ epoxy_get_proc_address(const char *name)
85 #endif /* PLATFORM_HAS_EGL */
86 +#if defined(_WIN32)
87 + return wglGetProcAddress(name);
88 +#elif defined(__APPLE__)
89 + return epoxy_gl_dlsym(name);
90 +#endif
91 errx(1, "Couldn't find current GLX or EGL context.\n");
92 -#endif /* _WIN32 | __APPLE__*/
95 WRAPPER_VISIBILITY (void)