if (backend_egl->egl_context != EGL_NO_CONTEXT)
return TRUE;
- edpy = clutter_egl_display ();
+ edpy = clutter_egl_get_egl_display ();
/* XXX: we should get rid of this goto yukkyness, there is a fail:
* goto at the end and this retry: goto at the top, but we should just
}
#endif
-#ifdef COGL_HAS_XLIB_SUPPORT
EGLDisplay
clutter_eglx_display (void)
{
- return backend_singleton->edpy;
+ return clutter_egl_get_egl_display ();
}
-#endif /* COGL_HAS_XLIB_SUPPORT */
EGLDisplay
clutter_egl_display (void)
{
- return backend_singleton->edpy;
+ return clutter_egl_get_egl_display ();
}
+EGLDisplay
+clutter_egl_get_egl_display (void)
+{
+ if (backend_singleton == NULL)
+ {
+ g_critical (G_STRFUNC " has been called before clutter_init()");
+ return 0;
+ }
+
+ return backend_singleton->edpy;
+}
G_BEGIN_DECLS
-#ifdef COGL_HAS_XLIB_SUPPORT
+#ifndef CLUTTER_DISABLE_DEPRECATED
/**
* clutter_eglx_display:
*
- * Retrieves the <structname>EGLDisplay</structname> used by Clutter
+ * Retrieves the <structname>EGLDisplay</structname> used by Clutter,
+ * if Clutter has been compiled with EGL and X11 support.
*
* Return value: the EGL display
*
* Since: 0.4
+ *
+ * Deprecated: 1.6: Use clutter_egl_get_egl_display() instead
*/
-EGLDisplay
-clutter_eglx_display (void);
-#endif
+EGLDisplay clutter_eglx_display (void);
/**
* clutter_egl_display:
* Retrieves the <structname>EGLDisplay</structname> used by Clutter
*
* Return value: the EGL display
+ *
+ * Deprecated: 1.6: Use clutter_egl_get_egl_display() instead
+ */
+EGLDisplay clutter_egl_display (void);
+#endif /* CLUTTER_DISABLE_DEPRECATED */
+
+/**
+ * clutter_egl_get_egl_display:
+ *
+ * Retrieves the <structname>EGLDisplay</structname> used by Clutter.
+ *
+ * Return value: the EGL display
+ *
+ * Since: 1.6
*/
-EGLDisplay
-clutter_egl_display (void);
+EGLDisplay clutter_egl_get_egl_display (void);
G_END_DECLS
return clutter_backend_egl_get_type ();
}
+/**
+ * clutter_egl_display:
+ *
+ * Retrieves the <structname>EGLDisplay</structname> used by Clutter.
+ *
+ * Return value: the EGL display
+ *
+ * Deprecated: 1.6: Use clutter_fruity_get_egl_display() instead
+ *
+ * Since: 0.6
+ */
EGLDisplay
clutter_egl_display (void)
{
return backend_singleton->edpy;
}
+/**
+ * clutter_fruity_egl_display:
+ *
+ * Retrieves the <structname>EGLDisplay</structname> used by Clutter.
+ *
+ * Return value: the EGL display
+ *
+ * Since: 1.6
+ */
+EGLDisplay
+clutter_fruity_get_egl_display (void)
+{
+ if (backend_singleton == NULL)
+ {
+ g_critical (G_STRFUNC " has been called before clutter_init()");
+ return 0;
+ }
+
+ return backend_singleton->edpy;
+}
+
void *rpl_malloc (size_t allocation)
{
return g_malloc (allocation);
G_BEGIN_DECLS
-EGLDisplay clutter_egl_display (void);
-void clutter_uikit_main (void);
+#ifndef CLUTTER_DISABLE_DEPRECATED
+EGLDisplay clutter_egl_display (void);
+#endif
+
+EGLDisplay clutter_fruity_get_egl_display (void);
+
+void clutter_uikit_main (void);
G_END_DECLS
if (stage_egl->egl_surface)
{
- eglDestroySurface (clutter_egl_display (), stage_egl->egl_surface);
+ eglDestroySurface (clutter_fruity_get_egl_display (),
+ stage_egl->egl_surface);
stage_egl->egl_surface = EGL_NO_SURFACE;
}
}
GError **error)
{
ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend);
- EGLDisplay edpy;
const char *error_message;
- edpy = clutter_egl_display ();
-
eglBindAPI (EGL_OPENGL_API);
if (backend_wayland->egl_context == EGL_NO_CONTEXT)
static const EGLint *attribs = NULL;
#endif
- backend_wayland->egl_context = eglCreateContext (edpy,
- NULL,
- EGL_NO_CONTEXT,
- attribs);
+ backend_wayland->egl_context =
+ eglCreateContext (backend_wayland->edpy,
+ NULL,
+ EGL_NO_CONTEXT,
+ attribs);
if (backend_wayland->egl_context == EGL_NO_CONTEXT)
{
error_message = "Unable to create a suitable EGL context";
CLUTTER_NOTE (GL, "Created EGL Context");
}
- if (!eglMakeCurrent (edpy, NULL, NULL, backend_wayland->egl_context))
+ if (!eglMakeCurrent (backend_wayland->edpy,
+ NULL,
+ NULL,
+ backend_wayland->egl_context))
{
g_set_error (error, CLUTTER_INIT_ERROR,
CLUTTER_INIT_ERROR_BACKEND,
GError **error)
{
ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend);
- EGLDisplay edpy;
const gchar *egl_extensions = NULL;
gboolean status;
int retry_cookie;
if (backend_wayland->egl_context != EGL_NO_CONTEXT)
return TRUE;
- edpy = clutter_egl_display ();
-
- egl_extensions = eglQueryString (edpy, EGL_EXTENSIONS);
+ egl_extensions = eglQueryString (backend_wayland->edpy, EGL_EXTENSIONS);
if (!_cogl_check_extension ("EGL_KHR_surfaceless_opengl", egl_extensions))
{
}
EGLDisplay
-clutter_egl_display (void)
+clutter_wayland_get_egl_display (void)
{
return backend_singleton->edpy;
}
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend);
- EGLDisplay edpy = clutter_egl_display ();
+ EGLDisplay edpy = clutter_wayland_get_egl_display ();
ClutterStageWaylandWaylandBuffer *buffer;
EGLint image_attribs[] = {
EGL_WIDTH, 0,
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterBackendWayland *backend_wayland = CLUTTER_BACKEND_WAYLAND (backend);
- EGLDisplay edpy = clutter_egl_display ();
+ EGLDisplay edpy = clutter_wayland_get_egl_display ();
cogl_handle_unref (buffer->tex);
wl_buffer_destroy (buffer->wayland_buffer);
G_BEGIN_DECLS
/**
- * clutter_egl_display:
+ * clutter_wayland_get_egl_display:
*
* Retrieves the <structname>EGLDisplay</structname> used by Clutter
*
* Return value: the EGL display
+ *
+ * Since: 1.6
*/
-EGLDisplay
-clutter_egl_display (void);
+EGLDisplay clutter_wayland_get_egl_display (void);
G_END_DECLS
<SECTION>
<FILE>clutter-wayland</FILE>
<TITLE>Wayland Specific Support</TITLE>
-clutter_egl_display
+clutter_wayland_get_egl_display
</SECTION>
<SECTION>
<FILE>clutter-egl</FILE>
clutter_egl_display
clutter_eglx_display
+clutter_egl_get_egl_display
</SECTION>
<SECTION>