[PATCH weston 1/2] tests: Include weston-egl-ext from weston-test

Daniel Stone daniel at fooishbar.org
Thu Feb 12 00:43:25 PST 2015


Hi,

On Thursday, February 12, 2015, Bryce Harrington <bryce at osg.samsung.com>
wrote:

> On Wed, Feb 11, 2015 at 06:15:17PM +0000, Daniel Stone wrote:
> > weston-test uses eglBindWaylandDisplayWL and friends, which are defined
> > either by the EGL implementation, or weston-egl-ext.h as a fallback.
> > Include weston-egl-ext.h from weston-test, so we can build on systems
> > whose native EGL implementation doesn't give us the needed defines.
>
> This sounds sensible, however looking at weston-egl-ext.h, the three
> egl*WL functions appear to get declared only when EGL_EGLEXT_PROTOTYPES
> is defined, and I'm not spotting where that comes in.  I'm sure you're
> correct here, but could you help me connect the dots?
>

The function pointer types (e.g. EGLBINDWAYLANDDISPLAYWLPROC) are declared
unconditionally, to support using eglGetProcAddress, typecasting, and
calling. The bare function definitions are hidden behind a separate
#define, as you are supposed to do extension lookups through GetProcAddress
instead. So there's essentially a define which just lets you be lazy if you
know you can get away with it.

See the core eglext.h for this pattern repeated ad nauseum.

Cheers,
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150212/d74f8afc/attachment-0001.html>


More information about the wayland-devel mailing list