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 * Release the driver resource.
49 * It is called before dlclose().
51 void (*Unload
)(_EGLDriver
*drv
);
53 _EGLAPI API
; /**< EGL API dispatch table */
58 _eglBuiltInDriverGALLIUM(const char *args
);
62 _eglBuiltInDriverDRI2(const char *args
);
66 _eglBuiltInDriverGLX(const char *args
);
70 _eglMain(const char *args
);
74 _eglMatchDriver(_EGLDisplay
*dpy
, EGLBoolean test_only
);
77 extern __eglMustCastToProperFunctionPointerType
78 _eglGetDriverProc(const char *procname
);
82 _eglUnloadDrivers(void);
85 /* defined in eglfallbacks.c */
87 _eglInitDriverFallbacks(_EGLDriver
*drv
);
91 _eglSearchPathForEach(EGLBoolean (*callback
)(const char *, size_t, void *),
95 #endif /* EGLDRIVER_INCLUDED */