/**************************************************************************1*2* Copyright 2008 VMware, Inc.3* Copyright 2009-2010 Chia-I Wu <[email protected]>4* Copyright 2010-2011 LunarG, Inc.5* All Rights Reserved.6*7* Permission is hereby granted, free of charge, to any person obtaining a8* copy of this software and associated documentation files (the9* "Software"), to deal in the Software without restriction, including10* without limitation the rights to use, copy, modify, merge, publish,11* distribute, sub license, and/or sell copies of the Software, and to12* permit persons to whom the Software is furnished to do so, subject to13* the following conditions:14*15* The above copyright notice and this permission notice (including the16* next paragraph) shall be included in all copies or substantial portions17* of the Software.18*19* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR20* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,21* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL22* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER23* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING24* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER25* DEALINGS IN THE SOFTWARE.26*27**************************************************************************/282930#ifndef EGLGLOBALS_INCLUDED31#define EGLGLOBALS_INCLUDED3233#include <stdbool.h>34#include "c11/threads.h"3536#include "egltypedefs.h"3738enum39{40_EGL_DEBUG_BIT_CRITICAL = 0x1,41_EGL_DEBUG_BIT_ERROR = 0x2,42_EGL_DEBUG_BIT_WARN = 0x4,43_EGL_DEBUG_BIT_INFO = 0x8,44};4546/**47* Global library data48*/49struct _egl_global50{51mtx_t *Mutex;5253/* the list of all displays */54_EGLDisplay *DisplayList;5556_EGLDevice *DeviceList;5758EGLint NumAtExitCalls;59void (*AtExitCalls[10])(void);6061/*62* Under libglvnd, the client extension string has to be split into two63* strings, one for platform extensions, and one for everything else.64* For a non-glvnd build create a concatenated one.65*/66#if USE_LIBGLVND67const char *ClientOnlyExtensionString;68const char *PlatformExtensionString;69#else70const char *ClientExtensionString;71#endif7273EGLDEBUGPROCKHR debugCallback;74unsigned int debugTypesEnabled;75};767778extern struct _egl_global _eglGlobal;798081extern void82_eglAddAtExitCall(void (*func)(void));8384static inline unsigned int DebugBitFromType(EGLenum type)85{86assert(type >= EGL_DEBUG_MSG_CRITICAL_KHR && type <= EGL_DEBUG_MSG_INFO_KHR);87return (1 << (type - EGL_DEBUG_MSG_CRITICAL_KHR));88}8990/**91* Perform validity checks on a generic pointer.92*/93extern EGLBoolean94_eglPointerIsDereferencable(void *p);9596#endif /* EGLGLOBALS_INCLUDED */979899