1 #ifndef EGLCURRENT_INCLUDED
2 #define EGLCURRENT_INCLUDED
4 #include "egltypedefs.h"
7 #define _EGL_API_ALL_BITS \
10 EGL_OPENGL_ES2_BIT | \
14 #define _EGL_API_FIRST_API EGL_OPENGL_ES_API
15 #define _EGL_API_LAST_API EGL_OPENGL_API
16 #define _EGL_API_NUM_APIS (_EGL_API_LAST_API - _EGL_API_FIRST_API + 1)
22 struct _egl_thread_info
25 _EGLContext
*CurrentContexts
[_EGL_API_NUM_APIS
];
26 /* use index for fast access to current context */
27 EGLint CurrentAPIIndex
;
32 * Return true if a client API enum is recognized.
34 static INLINE EGLBoolean
35 _eglIsApiValid(EGLenum api
)
37 return (api
>= _EGL_API_FIRST_API
&& api
<= _EGL_API_LAST_API
);
42 * Convert a client API enum to an index, for use by thread info.
43 * The client API enum is assumed to be valid.
46 _eglConvertApiToIndex(EGLenum api
)
48 return api
- _EGL_API_FIRST_API
;
53 * Convert an index, used by thread info, to a client API enum.
54 * The index is assumed to be valid.
57 _eglConvertApiFromIndex(EGLint idx
)
59 return _EGL_API_FIRST_API
+ idx
;
63 PUBLIC _EGLThreadInfo
*
64 _eglGetCurrentThread(void);
68 _eglDestroyCurrentThread(void);
72 _eglIsCurrentThreadDummy(void);
76 _eglGetAPIContext(EGLenum api
);
80 _eglGetCurrentContext(void);
84 _eglError(EGLint errCode
, const char *msg
);
87 #endif /* EGLCURRENT_INCLUDED */