summaryrefslogtreecommitdiff
path: root/src/egl/main/eglglobals.h
blob: 14d8ea487af04467a83ba8d0b0f973642c434421 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef EGLGLOBALS_INCLUDED
#define EGLGLOBALS_INCLUDED

#include "egltypedefs.h"
#include "eglhash.h"


/**
 * Per-thread info
 */
struct _egl_thread_info
{
   EGLint LastError;
   _EGLContext *CurrentContext;
   EGLenum CurrentAPI;
};


/**
 * Global library data
 */
struct _egl_global
{
   EGLBoolean Initialized;

   _EGLHashtable *Displays;
   _EGLHashtable *Surfaces;

   EGLScreenMESA FreeScreenHandle;

   /* bitmaks of supported APIs (supported by _some_ driver) */
   EGLint ClientAPIsMask;

   char ClientAPIs[1000];   /**< updated by eglQueryString */

   /* XXX temporary - should be thread-specific data (TSD) */
   _EGLThreadInfo *ThreadInfo;

   EGLint NumDrivers;
   _EGLDriver *Drivers[10];
};


extern struct _egl_global _eglGlobal;


extern void
_eglInitGlobals(void);


extern void
_eglDestroyGlobals(void);


extern _EGLThreadInfo *
_eglNewThreadInfo(void);


extern void
_eglDeleteThreadData(_EGLThreadInfo *t);


extern _EGLThreadInfo *
_eglGetCurrentThread(void);


extern void
_eglError(EGLint errCode, const char *msg);


#endif /* EGLGLOBALS_INCLUDED */