return NULL;
}
- if (!_eglInitSurface(&surface->surf, disp, EGL_WINDOW_BIT, conf, attrib_list))
- goto cleanup_surface;
+ if (!_eglInitSurface(&surface->surf, disp, EGL_WINDOW_BIT,
+ conf, attrib_list)) {
+ free(surface);
+ return NULL;
+ }
(&surface->surf)->SwapInterval = 1;
TRACE("Showing window\n");
win->Show();
return &surface->surf;
-
-cleanup_surface:
- free(surface);
- return NULL;
}
if (_eglPutSurface(surf)) {
// XXX: detach haiku_egl_surface::gl from the native window and destroy it
free(surf);
- }
+ }
return EGL_TRUE;
}
conf = (struct haiku_egl_config*) calloc(1, sizeof (*conf));
if (!conf) {
_eglError(EGL_BAD_ALLOC, "haiku_add_configs_for_visuals");
- return NULL;
+ return EGL_FALSE;
}
_eglInitConfig(&conf->base, dpy, 1);
_eglSetConfigKey(&conf->base, EGL_LUMINANCE_SIZE, 0);
_eglSetConfigKey(&conf->base, EGL_ALPHA_SIZE, 8);
_eglSetConfigKey(&conf->base, EGL_COLOR_BUFFER_TYPE, EGL_RGB_BUFFER);
- EGLint r = (_eglGetConfigKey(&conf->base, EGL_RED_SIZE)
+ EGLint r = (_eglGetConfigKey(&conf->base, EGL_RED_SIZE)
+ _eglGetConfigKey(&conf->base, EGL_GREEN_SIZE)
+ _eglGetConfigKey(&conf->base, EGL_BLUE_SIZE)
+ _eglGetConfigKey(&conf->base, EGL_ALPHA_SIZE));
goto cleanup;
}
TRACE("Validated config\n");
-
+
_eglLinkConfig(&conf->base);
if (!_eglGetArraySize(dpy->Configs)) {
_eglLog(_EGL_WARNING, "Haiku: failed to create any config");
return EGL_FALSE;
}
+
extern "C"
EGLBoolean
init_haiku(_EGLDriver *drv, _EGLDisplay *dpy)
return EGL_FALSE;
dpy->Version = 14;
-
+
TRACE("Initialization finished\n");
return EGL_TRUE;
if (_eglPutContext(ctx)) {
// XXX: teardown the context ?
free(context);
- ctx = NULL
+ ctx = NULL;
}
return EGL_TRUE;
}
extern "C"
EGLBoolean
haiku_make_current(_EGLDriver* drv, _EGLDisplay* dpy, _EGLSurface *dsurf,
- _EGLSurface *rsurf, _EGLContext *ctx)
+ _EGLSurface *rsurf, _EGLContext *ctx)
{
CALLED();
void
haiku_unload(_EGLDriver* drv)
{
-
+
}