1 #ifndef EGLCURRENT_INCLUDED
2 #define EGLCURRENT_INCLUDED
4 #include "egltypedefs.h"
7 #define _EGL_API_NUM_INDICES \
8 (EGL_OPENGL_API - EGL_OPENGL_ES_API + 2) /* idx 0 is for EGL_NONE */
14 struct _egl_thread_info
17 _EGLContext
*CurrentContexts
[_EGL_API_NUM_INDICES
];
18 /* use index for fast access to current context */
19 EGLint CurrentAPIIndex
;
24 * Return true if a client API enum can be converted to an index.
26 static INLINE EGLBoolean
27 _eglIsApiValid(EGLenum api
)
29 return ((api
>= EGL_OPENGL_ES_API
&& api
<= EGL_OPENGL_API
) ||
35 * Convert a client API enum to an index, for use by thread info.
36 * The client API enum is assumed to be valid.
39 _eglConvertApiToIndex(EGLenum api
)
41 return (api
!= EGL_NONE
) ? api
- EGL_OPENGL_ES_API
+ 1 : 0;
46 * Convert an index, used by thread info, to a client API enum.
47 * The index is assumed to be valid.
50 _eglConvertApiFromIndex(EGLint idx
)
52 return (idx
) ? EGL_OPENGL_ES_API
+ idx
- 1 : EGL_NONE
;
56 extern _EGLThreadInfo
*
57 _eglGetCurrentThread(void);
61 _eglDestroyCurrentThread(void);
65 _eglIsCurrentThreadDummy(void);
69 _eglGetCurrentContext(void);
73 _eglGetCurrentDisplay(void);
77 _eglGetCurrentSurface(EGLint readdraw
);
81 _eglError(EGLint errCode
, const char *msg
);
84 #endif /* EGLCURRENT_INCLUDED */