1 #ifndef EGLDRIVER_INCLUDED
2 #define EGLDRIVER_INCLUDED
5 #include "egltypedefs.h"
10 * Define an inline driver typecast function.
12 * Note that this macro defines a function and should not be ended with a
13 * semicolon when used.
15 #define _EGL_DRIVER_TYPECAST(drvtype, egltype, code) \
16 static INLINE struct drvtype *drvtype(const egltype *obj) \
17 { return (struct drvtype *) code; }
21 * Define the driver typecast functions for _EGLDriver, _EGLDisplay,
22 * _EGLContext, _EGLSurface, and _EGLConfig.
24 * Note that this macro defines several functions and should not be ended with
25 * a semicolon when used.
27 #define _EGL_DRIVER_STANDARD_TYPECASTS(drvname) \
28 _EGL_DRIVER_TYPECAST(drvname ## _driver, _EGLDriver, obj) \
29 /* note that this is not a direct cast */ \
30 _EGL_DRIVER_TYPECAST(drvname ## _display, _EGLDisplay, obj->DriverData) \
31 _EGL_DRIVER_TYPECAST(drvname ## _context, _EGLContext, obj) \
32 _EGL_DRIVER_TYPECAST(drvname ## _surface, _EGLSurface, obj) \
33 _EGL_DRIVER_TYPECAST(drvname ## _config, _EGLConfig, obj)
36 typedef _EGLDriver
*(*_EGLMain_t
)(const char *args
);
40 * Base class for device drivers.
44 const char *Name
; /**< name of this driver */
47 * Probe a display and return a score.
50 * 50 means the driver supports the display;
51 * 90 means the driver can accelerate the display;
52 * 100 means a perfect match.
54 EGLint (*Probe
)(_EGLDriver
*drv
, _EGLDisplay
*dpy
);
57 * Release the driver resource.
59 * It is called before dlclose().
61 void (*Unload
)(_EGLDriver
*drv
);
63 _EGLAPI API
; /**< EGL API dispatch table */
68 _eglMain(const char *args
);
72 _eglMatchDriver(_EGLDisplay
*dpy
, EGLBoolean probe_only
);
75 extern __eglMustCastToProperFunctionPointerType
76 _eglGetDriverProc(const char *procname
);
80 _eglUnloadDrivers(void);
83 /* defined in eglfallbacks.c */
85 _eglInitDriverFallbacks(_EGLDriver
*drv
);
89 _eglSearchPathForEach(EGLBoolean (*callback
)(const char *, size_t, void *),
93 #endif /* EGLDRIVER_INCLUDED */