aboutsummaryrefslogtreecommitdiff
path: root/backend/egl.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend/egl.c')
-rw-r--r--backend/egl.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/backend/egl.c b/backend/egl.c
index 2aac25b7..3462113c 100644
--- a/backend/egl.c
+++ b/backend/egl.c
@@ -73,6 +73,7 @@ static bool egl_get_config(EGLDisplay disp, EGLConfig *out) {
ret = eglGetConfigs(disp, NULL, 0, &count);
if (ret == EGL_FALSE || count == 0) {
+ wlr_log(L_ERROR, "eglGetConfigs returned no configs");
return false;
}
@@ -80,12 +81,19 @@ static bool egl_get_config(EGLDisplay disp, EGLConfig *out) {
ret = eglChooseConfig(disp, NULL, configs, count, &matched);
if (ret == EGL_FALSE) {
+ wlr_log(L_ERROR, "eglChooseConfig failed");
return false;
}
for (int i = 0; i < matched; ++i) {
EGLint gbm_format;
+ // TODO, see below
+ // best would probably be to propagate parameter or config
+ // choose callback
+ *out = configs[i];
+ return true;
+
if (!eglGetConfigAttrib(disp,
configs[i],
EGL_NATIVE_VISUAL_ID,
@@ -101,6 +109,7 @@ static bool egl_get_config(EGLDisplay disp, EGLConfig *out) {
}
}
+ wlr_log(L_ERROR, "no valid egl config found");
return false;
}
@@ -109,7 +118,7 @@ bool wlr_egl_init(struct wlr_egl *egl, EGLenum platform, void *display) {
if (!egl_exts()) {
return false;
}
-
+
if (eglBindAPI(EGL_OPENGL_ES_API) == EGL_FALSE) {
wlr_log(L_ERROR, "Failed to bind to the OpenGL ES API: %s", egl_error());
goto error;
@@ -163,7 +172,7 @@ void wlr_egl_free(struct wlr_egl *egl) {
eglDestroyContext(egl->display, egl->context);
eglTerminate(egl->display);
eglReleaseThread();
- eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+ eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
}
EGLSurface wlr_egl_create_surface(struct wlr_egl *egl, void *window) {