Skip to content

Commit c231b85

Browse files
committed
Enabling experimental DLSYM support
1 parent c506d25 commit c231b85

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

k_eglGetDisplayCopy.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ along with this program; if not, write to the Free Software
2727
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2828
2929
*/
30-
int x11_enabled;
30+
31+
#ifdef X11EGLRPI_EXPERIMENTAL_DLSYM
32+
static int (*real_eglGetDisplay)(NativeDisplayType) = NULL;
33+
static EGLSurface (*real_eglCreateWindowSurface)(EGLDisplay egldisplay, EGLConfig config, NativeWindowType native_window, EGLint const * attrib_list) = NULL;
34+
static EGLBoolean (*real_eglSwapBuffers)(EGLDisplay edisplay, EGLSurface egsurface) = NULL;
35+
#endif
36+
static int x11_enabled = 0;
3137
Window* root;
3238
Window* window;
3339
EGLDisplay *edisplay;
@@ -36,6 +42,11 @@ Display* display;
3642
EGLSurface egl_surface;
3743
XWindowAttributes *window_attributes_return;
3844
EGLDisplay eglGetDisplay(NativeDisplayType native_display) {
45+
#ifdef X11EGLRPI_EXPERIMENTAL_DLSYM
46+
real_eglGetDisplay = dlsym(RTLD_NEXT, "eglGetDisplay");
47+
real_eglCreateWindowSurface = dlsym(RTLD_NEXT,"eglCreateWindowSurface");
48+
real_eglSwapBuffers= dlsym(RTLD_NEXT,"eglSwapBuffers");
49+
#endif
3950
if ( native_display == EGL_DEFAULT_DISPLAY) {
4051
x11_enabled=0;
4152
return real_eglGetDisplay(native_display);

0 commit comments

Comments
 (0)