From b2006a40eb22899d38cd31691640555228e36975 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 30 Jan 2006 00:10:55 +0000 Subject: some initial EGL 1.2 work --- src/egl/main/eglglobals.c | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) (limited to 'src/egl/main/eglglobals.c') 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 +#include #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(); } } @@ -38,6 +42,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. @@ -46,8 +77,10 @@ _eglDestroyGlobals(void) _EGLThreadInfo * _eglGetCurrentThread(void) { + _eglInitGlobals(); + /* XXX temporary */ - return &_eglGlobal.ThreadInfo; + return _eglGlobal.ThreadInfo; } -- cgit v1.2.3