1 #ifndef EGLCURRENT_INCLUDED
2 #define EGLCURRENT_INCLUDED
5 #include "egltypedefs.h"
8 #define _EGL_API_ALL_BITS \
11 EGL_OPENGL_ES2_BIT | \
15 #define _EGL_API_FIRST_API EGL_OPENGL_ES_API
16 #define _EGL_API_LAST_API EGL_OPENGL_API
17 #define _EGL_API_NUM_APIS (_EGL_API_LAST_API - _EGL_API_FIRST_API + 1)
23 struct _egl_thread_info
26 _EGLContext
*CurrentContexts
[_EGL_API_NUM_APIS
];
27 /* use index for fast access to current context */
28 EGLint CurrentAPIIndex
;
33 * Return true if a client API enum is recognized.
35 static INLINE EGLBoolean
36 _eglIsApiValid(EGLenum api
)
38 return (api
>= _EGL_API_FIRST_API
&& api
<= _EGL_API_LAST_API
);
43 * Convert a client API enum to an index, for use by thread info.
44 * The client API enum is assumed to be valid.
47 _eglConvertApiToIndex(EGLenum api
)
49 return api
- _EGL_API_FIRST_API
;
54 * Convert an index, used by thread info, to a client API enum.
55 * The index is assumed to be valid.
58 _eglConvertApiFromIndex(EGLint idx
)
60 return _EGL_API_FIRST_API
+ idx
;
64 PUBLIC _EGLThreadInfo
*
65 _eglGetCurrentThread(void);
69 _eglDestroyCurrentThread(void);
73 _eglIsCurrentThreadDummy(void);
77 _eglGetAPIContext(EGLenum api
);
81 _eglGetCurrentContext(void);
85 _eglError(EGLint errCode
, const char *msg
);
88 #endif /* EGLCURRENT_INCLUDED */