2009-07-17 20:36:06 +01:00
|
|
|
#ifndef EGLCURRENT_INCLUDED
|
|
|
|
#define EGLCURRENT_INCLUDED
|
|
|
|
|
2010-01-29 01:00:30 +00:00
|
|
|
|
2009-07-17 20:36:06 +01:00
|
|
|
#include "egltypedefs.h"
|
|
|
|
|
|
|
|
|
2009-08-17 08:53:54 +01:00
|
|
|
#define _EGL_API_ALL_BITS \
|
|
|
|
(EGL_OPENGL_ES_BIT | \
|
|
|
|
EGL_OPENVG_BIT | \
|
|
|
|
EGL_OPENGL_ES2_BIT | \
|
|
|
|
EGL_OPENGL_BIT)
|
|
|
|
|
|
|
|
|
|
|
|
#define _EGL_API_FIRST_API EGL_OPENGL_ES_API
|
|
|
|
#define _EGL_API_LAST_API EGL_OPENGL_API
|
|
|
|
#define _EGL_API_NUM_APIS (_EGL_API_LAST_API - _EGL_API_FIRST_API + 1)
|
2009-07-17 20:36:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Per-thread info
|
|
|
|
*/
|
|
|
|
struct _egl_thread_info
|
|
|
|
{
|
|
|
|
EGLint LastError;
|
2009-08-17 08:53:54 +01:00
|
|
|
_EGLContext *CurrentContexts[_EGL_API_NUM_APIS];
|
2009-07-17 20:36:06 +01:00
|
|
|
/* use index for fast access to current context */
|
|
|
|
EGLint CurrentAPIIndex;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2009-08-17 08:53:54 +01:00
|
|
|
* Return true if a client API enum is recognized.
|
2009-07-17 20:36:06 +01:00
|
|
|
*/
|
|
|
|
static INLINE EGLBoolean
|
|
|
|
_eglIsApiValid(EGLenum api)
|
|
|
|
{
|
2009-08-17 08:53:54 +01:00
|
|
|
return (api >= _EGL_API_FIRST_API && api <= _EGL_API_LAST_API);
|
2009-07-17 20:36:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Convert a client API enum to an index, for use by thread info.
|
|
|
|
* The client API enum is assumed to be valid.
|
|
|
|
*/
|
|
|
|
static INLINE EGLint
|
|
|
|
_eglConvertApiToIndex(EGLenum api)
|
|
|
|
{
|
2009-08-17 08:53:54 +01:00
|
|
|
return api - _EGL_API_FIRST_API;
|
2009-07-17 20:36:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Convert an index, used by thread info, to a client API enum.
|
|
|
|
* The index is assumed to be valid.
|
|
|
|
*/
|
|
|
|
static INLINE EGLenum
|
|
|
|
_eglConvertApiFromIndex(EGLint idx)
|
|
|
|
{
|
2009-08-17 08:53:54 +01:00
|
|
|
return _EGL_API_FIRST_API + idx;
|
2009-07-17 20:36:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-01-05 13:39:15 +00:00
|
|
|
PUBLIC _EGLThreadInfo *
|
2009-07-17 20:36:06 +01:00
|
|
|
_eglGetCurrentThread(void);
|
|
|
|
|
|
|
|
|
|
|
|
extern void
|
|
|
|
_eglDestroyCurrentThread(void);
|
|
|
|
|
|
|
|
|
|
|
|
extern EGLBoolean
|
|
|
|
_eglIsCurrentThreadDummy(void);
|
|
|
|
|
|
|
|
|
2010-01-26 08:52:14 +00:00
|
|
|
PUBLIC _EGLContext *
|
|
|
|
_eglGetAPIContext(EGLenum api);
|
|
|
|
|
|
|
|
|
2010-01-05 13:39:15 +00:00
|
|
|
PUBLIC _EGLContext *
|
2009-07-17 20:36:06 +01:00
|
|
|
_eglGetCurrentContext(void);
|
|
|
|
|
|
|
|
|
2010-01-05 13:39:15 +00:00
|
|
|
PUBLIC EGLBoolean
|
2009-07-17 20:36:06 +01:00
|
|
|
_eglError(EGLint errCode, const char *msg);
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* EGLCURRENT_INCLUDED */
|