fix bug [2021677] egl driver unloaded after eglTerminate() is called
refactored the code so that:
- EGL APIs that can be called before or after eglInitialize() will work by loading the drivers first
- make eglGetDisplay() a lot more efficient
- make sure that EGL drivers are loaded in a thread-safe way
- don't unload the drivers upon calling eglTerminate(), they're now never unloaded, since there is no safe way to do it (some thread could be running)
- updated our EGL version to 1.4
- return better error codes if errors happen during initialization
diff --git a/opengl/libs/hooks.h b/opengl/libs/hooks.h
index 37292ee..8c0357e 100644
--- a/opengl/libs/hooks.h
+++ b/opengl/libs/hooks.h
@@ -60,12 +60,8 @@
enum {
IMPL_HARDWARE = 0,
IMPL_SOFTWARE,
-
IMPL_NUM_DRIVERS_IMPLEMENTATIONS,
-
- IMPL_CONTEXT_LOST = IMPL_NUM_DRIVERS_IMPLEMENTATIONS,
- IMPL_NO_CONTEXT,
-
+ IMPL_NO_CONTEXT = IMPL_NUM_DRIVERS_IMPLEMENTATIONS,
IMPL_NUM_IMPLEMENTATIONS
};