EGLBoolean haiku_destroy_context(_EGLDriver* drv, _EGLDisplay *disp, _EGLContext* ctx) { struct haiku_egl_context* context = haiku_egl_context(ctx); if (_eglPutContext(ctx)) { // XXX: teardown the context ? free(context); ctx = NULL; } return EGL_TRUE; }
EGLBoolean haiku_make_current(_EGLDriver* drv, _EGLDisplay* dpy, _EGLSurface *dsurf, _EGLSurface *rsurf, _EGLContext *ctx) { struct haiku_egl_context* cont=haiku_egl_context(ctx); struct haiku_egl_surface* surf=haiku_egl_surface(dsurf); _EGLContext *old_ctx; _EGLSurface *old_dsurf, *old_rsurf; _eglBindContext(ctx, dsurf, rsurf, &old_ctx, &old_dsurf, &old_rsurf); //cont->ctx.DrawSurface=&surf->surf; surf->gl->LockGL(); return EGL_TRUE; }