EGLBoolean init_haiku(_EGLDriver *drv, _EGLDisplay *dpy) { _eglLog(_EGL_DEBUG,"\nInitializing Haiku EGL\n"); //_EGLDisplay* egl_dpy; printf("Initializing Haiku EGL\n"); _eglSetLogProc(haiku_log); loader_set_logger(_eglLog); /*egl_dpy = (_EGLDisplay*) calloc(1, sizeof(_EGLDisplay)); if (!egl_dpy) return _eglError(EGL_BAD_ALLOC, "eglInitialize"); dpy->DriverData=(void*) egl_dpy; if (!dpy->PlatformDisplay) { // OPEN DEVICE //dri2_dpy->bwindow = (void*)haiku_create_window(); //dri2_dpy->own_device = true; } else { //dri2_dpy->bwindow = (BWindow*)dpy->PlatformDisplay; }*/ //dri2_dpy->driver_name = strdup("swrast"); //if (!dri2_load_driver_swrast(dpy)) // goto cleanup_conn; /*dri2_dpy->swrast_loader_extension.base.name = __DRI_SWRAST_LOADER; dri2_dpy->swrast_loader_extension.base.version = __DRI_SWRAST_LOADER_VERSION; dri2_dpy->swrast_loader_extension.getDrawableInfo = swrastGetDrawableInfo; dri2_dpy->swrast_loader_extension.putImage = swrastPutImage; dri2_dpy->swrast_loader_extension.getImage = swrastGetImage; dri2_dpy->extensions[0] = &dri2_dpy->swrast_loader_extension.base; dri2_dpy->extensions[1] = NULL; dri2_dpy->extensions[2] = NULL;*/ /*if (dri2_dpy->bwindow) { if (!dri2_haiku_add_configs_for_visuals(dri2_dpy, dpy)) goto cleanup_configs; }*/ _eglLog(_EGL_DEBUG,"Add configs"); haiku_add_configs_for_visuals(dpy); dpy->VersionMajor=1; dpy->VersionMinor=4; //dpy->Extensions.KHR_create_context = true; //dri2_dpy->vtbl = &dri2_haiku_display_vtbl; _eglLog(_EGL_DEBUG, "Initialization finished"); return EGL_TRUE; }
EGLBoolean init_haiku(_EGLDriver *drv, _EGLDisplay *disp) { _EGLDevice *dev; CALLED(); dev = _eglAddDevice(-1, true); if (!dev) { _eglError(EGL_NOT_INITIALIZED, "DRI2: failed to find EGLDevice"); return EGL_FALSE; } disp->Device = dev; TRACE("Add configs\n"); if (!haiku_add_configs_for_visuals(disp)) return EGL_FALSE; disp->Version = 14; TRACE("Initialization finished\n"); return EGL_TRUE; }