|
14 | 14 | #if defined(HAVE_EGL) && defined(LINT_EGL_HEADERS)
|
15 | 15 |
|
16 | 16 | // This makes sure we only use EGL 1.4 definitions and prototypes.
|
17 |
| - #define EGL_EGL_PROTOTYPES 1 |
18 | 17 | #define EGL_VERSION_1_5 1
|
19 | 18 | #include <EGL/egl.h>
|
20 | 19 | #undef EGL_VERSION_1_5
|
|
395 | 394 |
|
396 | 395 | #endif
|
397 | 396 |
|
| 397 | +// Older egl.h doesn't define typedefs for standard EGL functions, for example on debian buster. |
| 398 | +// Define them ourselves if necessary. |
| 399 | +// |
| 400 | +// We don't use the function typedefs for functions part of 1.4, since |
| 401 | +// those should be present at all times and we just statically use them. |
| 402 | +// |
| 403 | +// For functions part of EGL 1.5 we dynamically resolve the functions at |
| 404 | +// runtime, since we can't be sure they're actually present. |
| 405 | +#if defined(EGL_VERSION_1_5) && !defined(EGL_EGL_PROTOTYPES) |
| 406 | + typedef EGLSync (EGLAPIENTRYP PFNEGLCREATESYNCPROC) (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list); |
| 407 | + typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCPROC) (EGLDisplay dpy, EGLSync sync); |
| 408 | + typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout); |
| 409 | + typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBPROC) (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value); |
| 410 | + typedef EGLImage (EGLAPIENTRYP PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list); |
| 411 | + typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image); |
| 412 | + typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void *native_display, const EGLAttrib *attrib_list); |
| 413 | + typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list); |
| 414 | + typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list); |
| 415 | + typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags); |
| 416 | +#endif |
| 417 | + |
398 | 418 | static inline bool check_egl_extension(const char *client_ext_string, const char *display_ext_string, const char *extension) {
|
399 | 419 | size_t len = strlen(extension);
|
400 | 420 |
|
|
0 commit comments