summaryrefslogtreecommitdiff
path: root/src/egl/main/eglcontext.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-05-27 13:45:41 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-05-27 13:45:41 -0600
commit1ed1027e886980b9b0f48fa6bfcf3d6e209c7787 (patch)
tree5f0128ab153890b56604f8d6d1746ab12a8aa659 /src/egl/main/eglcontext.c
parent3e4128963d4e1a27ef29658a3aa260f492091628 (diff)
assorted changes to compile with new EGL 1.4 headers (untested)
Diffstat (limited to 'src/egl/main/eglcontext.c')
-rw-r--r--src/egl/main/eglcontext.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/egl/main/eglcontext.c b/src/egl/main/eglcontext.c
index 374c006dae..bf26c1faa4 100644
--- a/src/egl/main/eglcontext.c
+++ b/src/egl/main/eglcontext.c
@@ -32,7 +32,7 @@ _eglInitContext(_EGLDriver *drv, EGLDisplay dpy, _EGLContext *ctx,
/* no attribs defined for now */
default:
_eglError(EGL_BAD_ATTRIBUTE, "eglCreateContext");
- return EGL_NO_CONTEXT;
+ return EGL_FALSE;
}
}
@@ -53,9 +53,10 @@ _eglInitContext(_EGLDriver *drv, EGLDisplay dpy, _EGLContext *ctx,
void
_eglSaveContext(_EGLContext *ctx)
{
+ EGLuint key = _eglHashGenKey(_eglGlobal.Contexts);
assert(ctx);
- ctx->Handle = _eglHashGenKey(_eglGlobal.Contexts);
- _eglHashInsert(_eglGlobal.Contexts, ctx->Handle, ctx);
+ ctx->Handle = (EGLContext) key;
+ _eglHashInsert(_eglGlobal.Contexts, key, ctx);
}
@@ -65,7 +66,8 @@ _eglSaveContext(_EGLContext *ctx)
void
_eglRemoveContext(_EGLContext *ctx)
{
- _eglHashRemove(_eglGlobal.Contexts, ctx->Handle);
+ EGLuint key = (EGLuint) ctx->Handle;
+ _eglHashRemove(_eglGlobal.Contexts, key);
}
@@ -76,7 +78,8 @@ _eglRemoveContext(_EGLContext *ctx)
_EGLContext *
_eglLookupContext(EGLContext ctx)
{
- _EGLContext *c = (_EGLContext *) _eglHashLookup(_eglGlobal.Contexts, ctx);
+ EGLuint key = (EGLuint) ctx;
+ _EGLContext *c = (_EGLContext *) _eglHashLookup(_eglGlobal.Contexts, key);
return c;
}
@@ -126,7 +129,8 @@ _eglDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext ctx)
{
_EGLContext *context = _eglLookupContext(ctx);
if (context) {
- _eglHashRemove(_eglGlobal.Contexts, ctx);
+ EGLuint key = (EGLuint) ctx;
+ _eglHashRemove(_eglGlobal.Contexts, key);
if (context->IsBound) {
context->DeletePending = EGL_TRUE;
}