summaryrefslogtreecommitdiff
path: root/src/egl/main/eglglobals.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-01-30 00:10:55 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-01-30 00:10:55 +0000
commitb2006a40eb22899d38cd31691640555228e36975 (patch)
tree4a54cd2f8b638936f7f24d842ab34106a6094a80 /src/egl/main/eglglobals.c
parentdaf3093f28353b27d277da4406324fbc41676a5b (diff)
some initial EGL 1.2 work
Diffstat (limited to 'src/egl/main/eglglobals.c')
-rw-r--r--src/egl/main/eglglobals.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/src/egl/main/eglglobals.c b/src/egl/main/eglglobals.c
index 83abd0a370..608311d749 100644
--- a/src/egl/main/eglglobals.c
+++ b/src/egl/main/eglglobals.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <stdlib.h>
#include "eglglobals.h"
@@ -18,9 +19,12 @@ _eglInitGlobals(void)
_eglGlobal.Surfaces = _eglNewHashTable();
_eglGlobal.FreeScreenHandle = 1;
_eglGlobal.Initialized = EGL_TRUE;
+
+ _eglGlobal.OpenGLESAPISupported = EGL_TRUE;
+ _eglGlobal.OpenVGAPISupported = EGL_FALSE;
+
/* XXX temporary */
- _eglGlobal.ThreadInfo.CurrentContext = EGL_NO_CONTEXT;
- _eglGlobal.ThreadInfo.LastError = EGL_SUCCESS;
+ _eglGlobal.ThreadInfo = _eglNewThreadInfo();
}
}
@@ -39,6 +43,33 @@ _eglDestroyGlobals(void)
/**
+ * Allocate and init a new _EGLThreadInfo object.
+ */
+_EGLThreadInfo *
+_eglNewThreadInfo(void)
+{
+ _EGLThreadInfo *t = (_EGLThreadInfo *) calloc(1, sizeof(_EGLThreadInfo));
+ if (t) {
+ t->CurrentContext = EGL_NO_CONTEXT;
+ t->LastError = EGL_SUCCESS;
+ t->CurrentAPI = EGL_NONE;
+ }
+ return t;
+}
+
+
+/**
+ * Delete/free a _EGLThreadInfo object.
+ */
+void
+_eglDeleteThreadData(_EGLThreadInfo *t)
+{
+ free(t);
+}
+
+
+
+/**
* Return pointer to calling thread's _EGLThreadInfo object.
* Create a new one if needed.
* Should never return NULL.
@@ -46,8 +77,10 @@ _eglDestroyGlobals(void)
_EGLThreadInfo *
_eglGetCurrentThread(void)
{
+ _eglInitGlobals();
+
/* XXX temporary */
- return &_eglGlobal.ThreadInfo;
+ return _eglGlobal.ThreadInfo;
}