static CoglBool _cogl_winsys_renderer_connect (CoglRenderer *renderer, CoglError **error) { CoglRendererEGL *egl_renderer; CoglRendererGDL *gdl_renderer; gdl_ret_t rc = GDL_SUCCESS; gdl_display_info_t gdl_display_info; renderer->winsys = g_slice_new0 (CoglRendererEGL); egl_renderer = renderer->winsys; gdl_renderer = g_slice_new0 (CoglRendererGDL); egl_renderer->platform = gdl_renderer; egl_renderer->platform_vtable = &_cogl_winsys_egl_vtable; egl_renderer->edpy = eglGetDisplay (EGL_DEFAULT_DISPLAY); if (!_cogl_winsys_egl_renderer_connect_common (renderer, error)) goto error; /* Check we can talk to the GDL library */ rc = gdl_init (NULL); if (rc != GDL_SUCCESS) { _cogl_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_INIT, "GDL initialize failed. %s", gdl_get_error_string (rc)); goto error; } rc = gdl_get_display_info (GDL_DISPLAY_ID_0, &gdl_display_info); if (rc != GDL_SUCCESS) { _cogl_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_INIT, "GDL failed to get display information: %s", gdl_get_error_string (rc)); gdl_close (); goto error; } gdl_close (); return TRUE; error: _cogl_winsys_renderer_disconnect (renderer); return FALSE; }
static void _cogl_winsys_renderer_disconnect (CoglRenderer *renderer) { CoglRendererEGL *egl_renderer = renderer->winsys; CoglRendererGDL *gdl_renderer = egl_renderer->platform; if (gdl_renderer->gdl_initialized) gdl_close (); eglTerminate (egl_renderer->edpy); g_slice_free (CoglRendererEGL, egl_renderer); }
static CoglBool gdl_plane_init (CoglDisplay *display, CoglError **error) { CoglBool ret = TRUE; gdl_color_space_t colorSpace = GDL_COLOR_SPACE_RGB; gdl_pixel_format_t pixfmt = GDL_PF_ARGB_32; gdl_rectangle_t dstRect; gdl_display_info_t display_info; gdl_ret_t rc = GDL_SUCCESS; if (!display->gdl_plane) { _cogl_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_CREATE_CONTEXT, "No GDL plane specified with " "cogl_gdl_display_set_plane"); return FALSE; } rc = gdl_init (NULL); if (rc != GDL_SUCCESS) { _cogl_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_CREATE_CONTEXT, "GDL initialize failed. %s", gdl_get_error_string (rc)); return FALSE; } rc = gdl_get_display_info (GDL_DISPLAY_ID_0, &display_info); if (rc != GDL_SUCCESS) { _cogl_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_CREATE_CONTEXT, "GDL failed to get display infomation: %s", gdl_get_error_string (rc)); gdl_close (); return FALSE; } dstRect.origin.x = 0; dstRect.origin.y = 0; dstRect.width = display_info.tvmode.width; dstRect.height = display_info.tvmode.height; /* Configure the plane attribute. */ rc = gdl_plane_reset (display->gdl_plane); if (rc == GDL_SUCCESS) rc = gdl_plane_config_begin (display->gdl_plane); if (rc == GDL_SUCCESS) rc = gdl_plane_set_attr (GDL_PLANE_SRC_COLOR_SPACE, &colorSpace); if (rc == GDL_SUCCESS) rc = gdl_plane_set_attr (GDL_PLANE_PIXEL_FORMAT, &pixfmt); if (rc == GDL_SUCCESS) rc = gdl_plane_set_attr (GDL_PLANE_DST_RECT, &dstRect); if (rc == GDL_SUCCESS) rc = gdl_plane_set_uint (GDL_PLANE_NUM_GFX_SURFACES, 3); if (rc == GDL_SUCCESS) rc = gdl_plane_config_end (GDL_FALSE); else gdl_plane_config_end (GDL_TRUE); if (rc != GDL_SUCCESS) { _cogl_set_error (error, COGL_WINSYS_ERROR, COGL_WINSYS_ERROR_CREATE_CONTEXT, "GDL configuration failed: %s.", gdl_get_error_string (rc)); ret = FALSE; } gdl_close (); return ret; }
/*!*********************************************************************** @Function OsReleaseOS @description Destroys main window *************************************************************************/ void PVRShellInit::OsReleaseOS() { #if defined(USE_GDL_PLANE) gdl_close(); #endif }
void CEGLNativeTypeBoxee::Destroy() { gdl_close(); return; }
static void IntelCE_CloseCursor() { gdl_unmap_surface(destination_surface_info.id); gdl_close(); }