gallium: add target-helpers/wrap_screen.c to C_SOURCES
[mesa/mesa-lb.git] / src / egl / main / README.txt
blobb3d253dd1330d18836205f49f1fabd098dbc4c59
3 Notes about the EGL library:
6 The EGL code here basically consists of two things:
8 1. An EGL API dispatcher.  This directly routes all the eglFooBar() API
9    calls into driver-specific functions.
11 2. Fallbacks for EGL API functions.  A driver _could_ implement all the
12    EGL API calls from scratch.  But in many cases, the fallbacks provided
13    in libEGL (such as eglChooseConfig()) will do the job.
17 Bootstrapping:
19 When the apps calls eglOpenDisplay() a device driver is selected and loaded
20 (look for dlsym() or LoadLibrary() in egldriver.c).
22 The driver's _eglMain() function is then called.  This driver function
23 allocates, initializes and returns a new _EGLDriver object (usually a
24 subclass of that type).
26 As part of initialization, the dispatch table in _EGLDriver->API must be
27 populated with all the EGL entrypoints.  Typically, _eglInitDriverFallbacks()
28 can be used to plug in default/fallback functions.  Some functions like
29 driver->API.Initialize and driver->API.Terminate _must_ be implemented
30 with driver-specific code (no default/fallback function is possible).
33 A bit later, the app will call eglInitialize().  This will get routed
34 to the driver->API.Initialize() function.  Any additional driver
35 initialization that wasn't done in _eglMain() should be done at this
36 point.  Typically, this will involve setting up visual configs, etc.
40 Special Functions:
42 Certain EGL functions _must_ be implemented by the driver.  This includes:
44 eglCreateContext
45 eglCreateWindowSurface
46 eglCreatePixmapSurface
47 eglCreatePBufferSurface
48 eglMakeCurrent
49 eglSwapBuffers
51 Most of the EGLConfig-related functions can be implemented with the
52 defaults/fallbacks.  Same thing for the eglGet/Query functions.
57 Teardown:
59 When eglTerminate() is called, the driver->API.Terminate() function is
60 called.  The driver should clean up after itself.  eglTerminate() will
61 then close/unload the driver (shared library).
66 Subclassing:
68 The internal libEGL data structures such as _EGLDisplay, _EGLContext,
69 _EGLSurface, etc should be considered base classes from which drivers
70 will derive subclasses.