2005-04-22 21:09:39 +00:00
|
|
|
#ifndef EGLDISPLAY_INCLUDED
|
|
|
|
#define EGLDISPLAY_INCLUDED
|
|
|
|
|
|
|
|
#include "egltypedefs.h"
|
2009-08-13 13:38:24 +08:00
|
|
|
#include "egldefines.h"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Optional EGL extensions info.
|
|
|
|
*/
|
|
|
|
struct _egl_extensions
|
|
|
|
{
|
|
|
|
EGLBoolean MESA_screen_surface;
|
|
|
|
EGLBoolean MESA_copy_context;
|
|
|
|
|
|
|
|
char String[_EGL_MAX_EXTENSIONS_LEN];
|
|
|
|
};
|
2005-04-22 21:09:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
struct _egl_display
|
|
|
|
{
|
2009-08-14 17:47:00 +08:00
|
|
|
/* used to link displays */
|
|
|
|
_EGLDisplay *Next;
|
|
|
|
|
2008-05-27 16:48:23 -06:00
|
|
|
EGLNativeDisplayType NativeDisplay;
|
2005-04-22 21:09:39 +00:00
|
|
|
|
|
|
|
_EGLDriver *Driver;
|
2009-08-13 13:38:24 +08:00
|
|
|
void *DriverData; /* private to driver */
|
|
|
|
|
|
|
|
int APImajor, APIminor; /**< as returned by eglInitialize() */
|
|
|
|
char Version[1000]; /**< initialized from APImajor/minor, DriverName */
|
|
|
|
|
|
|
|
/** Bitmask of supported APIs (EGL_xx_BIT) set by the driver during init */
|
|
|
|
EGLint ClientAPIsMask;
|
|
|
|
char ClientAPIs[1000]; /**< updated by eglQueryString */
|
|
|
|
|
|
|
|
_EGLExtensions Extensions;
|
|
|
|
|
|
|
|
int LargestPbuffer;
|
2005-04-22 21:09:39 +00:00
|
|
|
|
|
|
|
EGLint NumScreens;
|
2005-05-04 03:33:21 +00:00
|
|
|
_EGLScreen **Screens; /* array [NumScreens] */
|
2005-04-22 21:09:39 +00:00
|
|
|
|
2009-09-25 23:43:49 +08:00
|
|
|
EGLint MaxConfigs;
|
2005-04-22 21:09:39 +00:00
|
|
|
EGLint NumConfigs;
|
2008-06-04 11:34:10 -06:00
|
|
|
_EGLConfig **Configs; /* array [NumConfigs] of ptr to _EGLConfig */
|
2008-05-27 16:48:23 -06:00
|
|
|
|
2009-07-17 11:48:27 -06:00
|
|
|
/* lists of linked contexts and surface */
|
|
|
|
_EGLContext *ContextList;
|
|
|
|
_EGLSurface *SurfaceList;
|
2005-04-22 21:09:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2009-08-14 17:47:00 +08:00
|
|
|
extern void
|
|
|
|
_eglFiniDisplay(void);
|
|
|
|
|
|
|
|
|
2005-04-22 21:09:39 +00:00
|
|
|
extern _EGLDisplay *
|
|
|
|
_eglNewDisplay(NativeDisplayType displayName);
|
|
|
|
|
|
|
|
|
2009-07-17 11:48:27 -06:00
|
|
|
extern EGLDisplay
|
|
|
|
_eglLinkDisplay(_EGLDisplay *dpy);
|
|
|
|
|
|
|
|
|
|
|
|
extern void
|
|
|
|
_eglUnlinkDisplay(_EGLDisplay *dpy);
|
|
|
|
|
|
|
|
|
2009-07-16 21:21:56 -07:00
|
|
|
extern _EGLDisplay *
|
|
|
|
_eglFindDisplay(NativeDisplayType nativeDisplay);
|
|
|
|
|
|
|
|
|
2010-01-05 21:39:15 +08:00
|
|
|
PUBLIC void
|
2009-08-11 17:09:39 +08:00
|
|
|
_eglReleaseDisplayResources(_EGLDriver *drv, _EGLDisplay *dpy);
|
2009-07-16 21:21:57 -07:00
|
|
|
|
|
|
|
|
2010-01-05 21:39:15 +08:00
|
|
|
PUBLIC void
|
2009-07-17 11:48:27 -06:00
|
|
|
_eglCleanupDisplay(_EGLDisplay *disp);
|
|
|
|
|
|
|
|
|
2009-08-14 18:02:38 +08:00
|
|
|
#ifndef _EGL_SKIP_HANDLE_CHECK
|
|
|
|
|
|
|
|
|
|
|
|
extern EGLBoolean
|
|
|
|
_eglCheckDisplayHandle(EGLDisplay dpy);
|
|
|
|
|
|
|
|
|
|
|
|
#else /* !_EGL_SKIP_HANDLE_CHECK */
|
|
|
|
|
|
|
|
/* Only do a quick check. This is NOT standard compliant. */
|
|
|
|
|
|
|
|
static INLINE EGLBoolean
|
2009-08-19 13:00:25 +08:00
|
|
|
_eglCheckDisplayHandle(EGLDisplay dpy)
|
|
|
|
{
|
|
|
|
return ((_EGLDisplay *) dpy != NULL);
|
|
|
|
}
|
2009-08-14 18:02:38 +08:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* _EGL_SKIP_HANDLE_CHECK */
|
|
|
|
|
|
|
|
|
2009-07-17 11:56:00 -06:00
|
|
|
/**
|
2009-08-14 18:05:19 +08:00
|
|
|
* Lookup a handle to find the linked display.
|
|
|
|
* Return NULL if the handle has no corresponding linked display.
|
|
|
|
*/
|
|
|
|
static INLINE _EGLDisplay *
|
|
|
|
_eglLookupDisplay(EGLDisplay display)
|
|
|
|
{
|
|
|
|
_EGLDisplay *dpy = (_EGLDisplay *) display;
|
2009-08-14 18:02:38 +08:00
|
|
|
if (!_eglCheckDisplayHandle(display))
|
|
|
|
dpy = NULL;
|
2009-08-14 18:05:19 +08:00
|
|
|
return dpy;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the handle of a linked display, or EGL_NO_DISPLAY.
|
|
|
|
*/
|
|
|
|
static INLINE EGLDisplay
|
|
|
|
_eglGetDisplayHandle(_EGLDisplay *dpy)
|
|
|
|
{
|
|
|
|
return (EGLDisplay) ((dpy) ? dpy : EGL_NO_DISPLAY);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return true if the display is linked.
|
2009-07-17 11:56:00 -06:00
|
|
|
*/
|
|
|
|
static INLINE EGLBoolean
|
2009-08-14 18:05:19 +08:00
|
|
|
_eglIsDisplayLinked(_EGLDisplay *dpy)
|
2009-07-17 11:56:00 -06:00
|
|
|
{
|
2009-08-14 18:05:19 +08:00
|
|
|
return (EGLBoolean) (_eglGetDisplayHandle(dpy) != EGL_NO_DISPLAY);
|
2009-07-17 11:56:00 -06:00
|
|
|
}
|
|
|
|
|
2009-07-17 11:48:27 -06:00
|
|
|
|
2009-07-31 07:28:56 -06:00
|
|
|
/**
|
|
|
|
* Cast an unsigned int to a pointer.
|
|
|
|
*/
|
|
|
|
static INLINE void *
|
|
|
|
_eglUIntToPointer(unsigned int v)
|
|
|
|
{
|
|
|
|
return (void *) ((uintptr_t) v);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cast a pointer to an unsigned int. The pointer must be one that is
|
|
|
|
* returned by _eglUIntToPointer.
|
|
|
|
*/
|
|
|
|
static INLINE unsigned int
|
|
|
|
_eglPointerToUInt(const void *p)
|
|
|
|
{
|
|
|
|
return (unsigned int) ((uintptr_t) p);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-04-22 21:09:39 +00:00
|
|
|
#endif /* EGLDISPLAY_INCLUDED */
|