summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglglobals.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main/eglglobals.c')
-rw-r--r--src/egl/main/eglglobals.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/egl/main/eglglobals.c b/src/egl/main/eglglobals.c
index 102e5506206..6265b07529a 100644
--- a/src/egl/main/eglglobals.c
+++ b/src/egl/main/eglglobals.c
@@ -16,6 +16,7 @@ _eglInitGlobals(void)
_eglGlobal.Displays = _eglNewHashTable();
_eglGlobal.Contexts = _eglNewHashTable();
_eglGlobal.Surfaces = _eglNewHashTable();
+ _eglGlobal.FreeScreenHandle = 1;
_eglGlobal.CurrentContext = EGL_NO_CONTEXT;
_eglGlobal.LastError = EGL_SUCCESS;
_eglGlobal.Initialized = EGL_TRUE;
@@ -49,3 +50,16 @@ _eglError(EGLint errCode, const char *msg)
fprintf(stderr, "EGL Error 0x%x in %s\n", errCode, msg);
}
}
+
+
+/**
+ * Return a new screen handle/ID.
+ * NOTE: we never reuse these!
+ */
+EGLScreenMESA
+_eglAllocScreenHandle(void)
+{
+ EGLScreenMESA s = _eglGlobal.FreeScreenHandle;
+ _eglGlobal.FreeScreenHandle++;
+ return s;
+}