diff options
Diffstat (limited to 'src/egl.c')
-rw-r--r-- | src/egl.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -221,6 +221,7 @@ static bool gsr_egl_load_egl(gsr_egl *self, void *library) { { (void**)&self->eglDestroyContext, "eglDestroyContext" }, { (void**)&self->eglDestroySurface, "eglDestroySurface" }, { (void**)&self->eglBindAPI, "eglBindAPI" }, + { (void**)&self->eglGetProcAddress, "eglGetProcAddress" }, { NULL, NULL } }; @@ -248,6 +249,13 @@ static bool gsr_egl_load_gl(gsr_egl *self, void *library) { return true; } +static bool gsr_egl_proc_load_egl(gsr_egl *self) { + self->eglQueryDisplayAttribEXT = (FUNC_eglQueryDisplayAttribEXT)self->eglGetProcAddress("eglQueryDisplayAttribEXT"); + self->eglQueryDeviceStringEXT = (FUNC_eglQueryDeviceStringEXT)self->eglGetProcAddress("eglQueryDeviceStringEXT"); + + return true; +} + bool gsr_egl_load(gsr_egl *self, Display *dpy, bool wayland) { memset(self, 0, sizeof(gsr_egl)); self->x11.dpy = dpy; @@ -274,9 +282,18 @@ bool gsr_egl_load(gsr_egl *self, Display *dpy, bool wayland) { if(!gsr_egl_load_gl(self, gl_lib)) goto fail; + if(!gsr_egl_proc_load_egl(self)) + goto fail; + if(!gsr_egl_create_window(self, wayland)) goto fail; + if(self->eglQueryDisplayAttribEXT && self->eglQueryDeviceStringEXT) { + intptr_t device = 0; + if(self->eglQueryDisplayAttribEXT(self->egl_display, EGL_DEVICE_EXT, &device) && device) + self->dri_card_path = self->eglQueryDeviceStringEXT((void*)device, EGL_DRM_DEVICE_FILE_EXT); + } + self->egl_library = egl_lib; self->gl_library = gl_lib; return true; |