No intended change in behavior. Prepares for eventual use of eglGetPlatformDisplay.
Add an `EGLenum egl_platform` parameter to wegl_platform_init() and store it at wegl_platform::egl_platform. --- src/waffle/egl/wegl_platform.c | 5 ++++- src/waffle/egl/wegl_platform.h | 5 ++++- src/waffle/gbm/wgbm_platform.c | 2 +- src/waffle/wayland/wayland_platform.c | 2 +- src/waffle/xegl/xegl_platform.c | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/waffle/egl/wegl_platform.c b/src/waffle/egl/wegl_platform.c index 492f0da..7f030bd 100644 --- a/src/waffle/egl/wegl_platform.c +++ b/src/waffle/egl/wegl_platform.c @@ -54,8 +54,9 @@ wegl_platform_teardown(struct wegl_platform *self) ok &= wcore_platform_teardown(&self->wcore); return ok; } + bool -wegl_platform_init(struct wegl_platform *self) +wegl_platform_init(struct wegl_platform *self, EGLenum egl_platform) { bool ok; @@ -63,6 +64,8 @@ wegl_platform_init(struct wegl_platform *self) if (!ok) goto error; + self->egl_platform = egl_platform; + // Most Waffle platforms will call eglCreateWindowSurface. self->egl_surface_type_mask = EGL_WINDOW_BIT; diff --git a/src/waffle/egl/wegl_platform.h b/src/waffle/egl/wegl_platform.h index 00c3b8e..a3f9a79 100644 --- a/src/waffle/egl/wegl_platform.h +++ b/src/waffle/egl/wegl_platform.h @@ -35,6 +35,9 @@ struct wegl_platform { struct wcore_platform wcore; + // An EGL_PLATFORM_* enum, such as EGL_PLATFORM_GBM_KHR. + EGLenum egl_platform; + /// @brief Value of EGLConfig attribute EGL_SURFACE_TYPE /// /// When calling eglChooseConfig, Waffle sets the EGL_SURFACE_TYPE attribute @@ -92,4 +95,4 @@ bool wegl_platform_teardown(struct wegl_platform *self); bool -wegl_platform_init(struct wegl_platform *self); +wegl_platform_init(struct wegl_platform *self, EGLenum egl_platform); diff --git a/src/waffle/gbm/wgbm_platform.c b/src/waffle/gbm/wgbm_platform.c index 2b7f3bc..ee25a26 100644 --- a/src/waffle/gbm/wgbm_platform.c +++ b/src/waffle/gbm/wgbm_platform.c @@ -92,7 +92,7 @@ wgbm_platform_init(struct wgbm_platform *self) { bool ok = true; - ok = wegl_platform_init(&self->wegl); + ok = wegl_platform_init(&self->wegl, EGL_PLATFORM_GBM_KHR); if (!ok) goto error; diff --git a/src/waffle/wayland/wayland_platform.c b/src/waffle/wayland/wayland_platform.c index 2746ca1..3627c88 100644 --- a/src/waffle/wayland/wayland_platform.c +++ b/src/waffle/wayland/wayland_platform.c @@ -90,7 +90,7 @@ wayland_platform_create(void) if (self == NULL) return NULL; - ok = wegl_platform_init(&self->wegl); + ok = wegl_platform_init(&self->wegl, EGL_PLATFORM_WAYLAND_KHR); if (!ok) goto error; diff --git a/src/waffle/xegl/xegl_platform.c b/src/waffle/xegl/xegl_platform.c index e36a41b..66d7ed6 100644 --- a/src/waffle/xegl/xegl_platform.c +++ b/src/waffle/xegl/xegl_platform.c @@ -71,7 +71,7 @@ xegl_platform_create(void) if (self == NULL) return NULL; - ok = wegl_platform_init(&self->wegl); + ok = wegl_platform_init(&self->wegl, EGL_PLATFORM_X11_KHR); if (!ok) goto error; -- 2.10.0 _______________________________________________ waffle mailing list waffle@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/waffle