2007-10-12 04:17:00 -04:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2007-07-06 09:56:01 -04:00
|
|
|
#include "config.h"
|
2007-10-12 04:17:00 -04:00
|
|
|
#endif
|
2007-07-06 09:56:01 -04:00
|
|
|
|
2010-03-01 06:38:41 -05:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
2007-07-06 09:56:01 -04:00
|
|
|
#include "clutter-backend-egl.h"
|
|
|
|
#include "clutter-stage-egl.h"
|
2010-03-01 06:38:41 -05:00
|
|
|
|
2007-07-06 09:56:01 -04:00
|
|
|
#include "../clutter-private.h"
|
|
|
|
#include "../clutter-main.h"
|
|
|
|
#include "../clutter-debug.h"
|
|
|
|
|
|
|
|
static ClutterBackendEGL *backend_singleton = NULL;
|
|
|
|
|
2010-03-01 06:38:41 -05:00
|
|
|
static const gchar *clutter_fb_device = NULL;
|
|
|
|
|
2007-07-06 09:56:01 -04:00
|
|
|
G_DEFINE_TYPE (ClutterBackendEGL, clutter_backend_egl, CLUTTER_TYPE_BACKEND);
|
|
|
|
|
2008-09-22 12:36:27 -04:00
|
|
|
static void
|
|
|
|
clutter_backend_at_exit (void)
|
|
|
|
{
|
|
|
|
if (backend_singleton)
|
|
|
|
g_object_run_dispose (G_OBJECT (backend_singleton));
|
|
|
|
}
|
|
|
|
|
2007-07-06 09:56:01 -04:00
|
|
|
static gboolean
|
|
|
|
clutter_backend_egl_pre_parse (ClutterBackend *backend,
|
|
|
|
GError **error)
|
|
|
|
{
|
2010-03-01 06:38:41 -05:00
|
|
|
const gchar *env_string;
|
|
|
|
|
|
|
|
env_string = g_getenv ("CLUTTER_FB_DEVICE");
|
|
|
|
if (env_string != NULL && env_string[0] != '\0')
|
|
|
|
clutter_fb_device = g_strdup (env_string);
|
|
|
|
|
2007-07-06 09:56:01 -04:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
clutter_backend_egl_post_parse (ClutterBackend *backend,
|
|
|
|
GError **error)
|
|
|
|
{
|
2007-07-09 17:59:01 -04:00
|
|
|
ClutterBackendEGL *backend_egl = CLUTTER_BACKEND_EGL(backend);
|
|
|
|
EGLBoolean status;
|
|
|
|
|
2008-04-23 13:20:59 -04:00
|
|
|
backend_egl->edpy = eglGetDisplay (EGL_DEFAULT_DISPLAY);
|
2007-07-06 09:56:01 -04:00
|
|
|
|
2008-04-23 13:20:59 -04:00
|
|
|
status = eglInitialize (backend_egl->edpy,
|
|
|
|
&backend_egl->egl_version_major,
|
|
|
|
&backend_egl->egl_version_minor);
|
2007-07-06 09:56:01 -04:00
|
|
|
|
2008-09-22 12:36:27 -04:00
|
|
|
g_atexit (clutter_backend_at_exit);
|
|
|
|
|
2007-07-06 09:56:01 -04:00
|
|
|
if (status != EGL_TRUE)
|
|
|
|
{
|
|
|
|
g_set_error (error, CLUTTER_INIT_ERROR,
|
|
|
|
CLUTTER_INIT_ERROR_BACKEND,
|
|
|
|
"Unable to Initialize EGL");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
CLUTTER_NOTE (BACKEND, "EGL Reports version %i.%i",
|
|
|
|
backend_egl->egl_version_major,
|
|
|
|
backend_egl->egl_version_minor);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2008-04-23 13:20:59 -04:00
|
|
|
static void
|
|
|
|
clutter_backend_egl_ensure_context (ClutterBackend *backend,
|
|
|
|
ClutterStage *stage)
|
2007-07-06 09:56:01 -04:00
|
|
|
{
|
2010-02-27 04:42:42 -05:00
|
|
|
/* not doing anything since we only have one context and
|
|
|
|
* it is permanently made current
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
clutter_backend_egl_create_context (ClutterBackend *backend,
|
|
|
|
GError **error)
|
|
|
|
{
|
|
|
|
ClutterBackendEGL *backend_egl = CLUTTER_BACKEND_EGL (backend);
|
|
|
|
EGLConfig configs[2];
|
|
|
|
EGLint config_count;
|
|
|
|
EGLBoolean status;
|
|
|
|
EGLint cfg_attribs[] = {
|
|
|
|
EGL_BUFFER_SIZE, EGL_DONT_CARE,
|
|
|
|
EGL_RED_SIZE, 5,
|
|
|
|
EGL_GREEN_SIZE, 6,
|
|
|
|
EGL_BLUE_SIZE, 5,
|
|
|
|
EGL_DEPTH_SIZE, 16,
|
|
|
|
EGL_ALPHA_SIZE, EGL_DONT_CARE,
|
|
|
|
EGL_STENCIL_SIZE, 2,
|
|
|
|
#ifdef HAVE_COGL_GLES2
|
|
|
|
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
|
|
|
#else /* HAVE_COGL_GLES2 */
|
|
|
|
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
|
|
|
|
#endif /* HAVE_COGL_GLES2 */
|
|
|
|
EGL_NONE
|
|
|
|
};
|
|
|
|
|
|
|
|
status = eglGetConfigs (backend_egl->edpy,
|
|
|
|
configs,
|
|
|
|
2,
|
|
|
|
&config_count);
|
|
|
|
|
|
|
|
if (status != EGL_TRUE)
|
|
|
|
{
|
|
|
|
g_set_error (error, CLUTTER_INIT_ERROR,
|
|
|
|
CLUTTER_INIT_ERROR_BACKEND,
|
|
|
|
"No EGL configurations found");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
status = eglChooseConfig (backend_egl->edpy,
|
|
|
|
cfg_attribs,
|
|
|
|
configs,
|
|
|
|
G_N_ELEMENTS (configs),
|
|
|
|
&config_count);
|
|
|
|
|
|
|
|
if (status != EGL_TRUE)
|
|
|
|
{
|
|
|
|
g_set_error (error, CLUTTER_INIT_ERROR,
|
|
|
|
CLUTTER_INIT_ERROR_BACKEND,
|
|
|
|
"Unable to select a valid EGL configuration");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
CLUTTER_NOTE (BACKEND, "Got %i configs", config_count);
|
|
|
|
|
|
|
|
if (G_UNLIKELY (backend_egl->egl_surface != EGL_NO_SURFACE))
|
|
|
|
{
|
|
|
|
eglDestroySurface (backend_egl->edpy, backend_egl->egl_surface);
|
|
|
|
backend_egl->egl_surface = EGL_NO_SURFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (G_UNLIKELY (backend_egl->egl_context != NULL))
|
|
|
|
{
|
|
|
|
eglDestroyContext (backend_egl->edpy, backend_egl->egl_context);
|
|
|
|
backend_egl->egl_context = NULL;
|
|
|
|
}
|
|
|
|
|
2010-03-01 06:38:41 -05:00
|
|
|
if (clutter_fb_device != NULL)
|
|
|
|
{
|
|
|
|
int fd = open (clutter_fb_device, O_RDWR);
|
|
|
|
|
|
|
|
if (fd < 0)
|
|
|
|
{
|
|
|
|
int errno_save = errno;
|
|
|
|
|
|
|
|
g_set_error (error, CLUTTER_INIT_ERROR,
|
|
|
|
CLUTTER_INIT_ERROR_BACKEND,
|
|
|
|
"Unable to open the framebuffer device '%s': %s",
|
|
|
|
clutter_fb_device,
|
|
|
|
g_strerror (errno_save));
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
backend_egl->fb_device_id = fd;
|
|
|
|
|
|
|
|
backend_egl->egl_surface =
|
|
|
|
eglCreateWindowSurface (backend_egl->edpy,
|
|
|
|
configs[0],
|
|
|
|
(NativeWindowType) backend_egl->fb_device_id,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
backend_egl->egl_surface =
|
|
|
|
eglCreateWindowSurface (backend_egl->edpy,
|
|
|
|
configs[0],
|
|
|
|
NULL,
|
|
|
|
NULL);
|
|
|
|
}
|
2010-02-27 04:42:42 -05:00
|
|
|
|
|
|
|
if (backend_egl->egl_surface == EGL_NO_SURFACE)
|
|
|
|
{
|
|
|
|
g_set_error (error, CLUTTER_INIT_ERROR,
|
|
|
|
CLUTTER_INIT_ERROR_BACKEND,
|
|
|
|
"Unable to create EGL window surface");
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef HAVE_COGL_GLES2
|
|
|
|
{
|
|
|
|
static const EGLint attribs[3] = {
|
|
|
|
EGL_CONTEXT_CLIENT_VERSION, 2,
|
|
|
|
EGL_NONE
|
|
|
|
};
|
|
|
|
|
|
|
|
backend_egl->egl_context = eglCreateContext (backend_egl->edpy,
|
|
|
|
configs[0],
|
|
|
|
EGL_NO_CONTEXT,
|
|
|
|
attribs);
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
/* Seems some GLES implementations 1.x do not like attribs... */
|
|
|
|
backend_egl->egl_context = eglCreateContext (backend_egl->edpy,
|
|
|
|
configs[0],
|
|
|
|
EGL_NO_CONTEXT,
|
|
|
|
NULL);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (backend_egl->egl_context == EGL_NO_CONTEXT)
|
|
|
|
{
|
|
|
|
g_set_error (error, CLUTTER_INIT_ERROR,
|
|
|
|
CLUTTER_INIT_ERROR_BACKEND,
|
|
|
|
"Unable to create a suitable EGL context");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
CLUTTER_NOTE (GL, "Created EGL Context");
|
|
|
|
|
|
|
|
CLUTTER_NOTE (BACKEND, "Setting context");
|
|
|
|
|
|
|
|
/* eglnative can have only one stage, so we store the EGL surface
|
|
|
|
* in the backend itself, instead of the StageWindow implementation,
|
|
|
|
* and we make it current immediately to make sure the Cogl and
|
|
|
|
* Clutter can query the EGL context for features.
|
|
|
|
*/
|
|
|
|
status = eglMakeCurrent (backend_egl->edpy,
|
|
|
|
backend_egl->egl_surface,
|
|
|
|
backend_egl->egl_surface,
|
|
|
|
backend_egl->egl_context);
|
|
|
|
|
|
|
|
eglQuerySurface (backend_egl->edpy,
|
|
|
|
backend_egl->egl_surface,
|
|
|
|
EGL_WIDTH,
|
|
|
|
&backend_egl->surface_width);
|
|
|
|
|
|
|
|
eglQuerySurface (backend_egl->edpy,
|
|
|
|
backend_egl->egl_surface,
|
|
|
|
EGL_HEIGHT,
|
|
|
|
&backend_egl->surface_height);
|
|
|
|
|
|
|
|
CLUTTER_NOTE (BACKEND, "EGL surface is %ix%i",
|
|
|
|
backend_egl->surface_width,
|
|
|
|
backend_egl->surface_height);
|
|
|
|
|
|
|
|
return TRUE;
|
2008-04-23 13:20:59 -04:00
|
|
|
}
|
2007-07-06 09:56:01 -04:00
|
|
|
|
2008-04-23 13:20:59 -04:00
|
|
|
static void
|
|
|
|
clutter_backend_egl_redraw (ClutterBackend *backend,
|
|
|
|
ClutterStage *stage)
|
|
|
|
{
|
|
|
|
ClutterBackendEGL *backend_egl = CLUTTER_BACKEND_EGL (backend);
|
|
|
|
ClutterStageEGL *stage_egl;
|
|
|
|
ClutterStageWindow *impl;
|
|
|
|
|
|
|
|
impl = _clutter_stage_get_window (stage);
|
2010-02-27 04:42:42 -05:00
|
|
|
if (impl == NULL)
|
2008-04-23 13:20:59 -04:00
|
|
|
return;
|
2007-07-06 09:56:01 -04:00
|
|
|
|
2008-04-23 13:20:59 -04:00
|
|
|
g_assert (CLUTTER_IS_STAGE_EGL (impl));
|
|
|
|
stage_egl = CLUTTER_STAGE_EGL (impl);
|
|
|
|
|
2008-04-25 09:37:36 -04:00
|
|
|
eglWaitNative (EGL_CORE_NATIVE_ENGINE);
|
2010-02-27 04:42:42 -05:00
|
|
|
clutter_actor_paint (CLUTTER_ACTOR (stage_egl->wrapper));
|
2009-06-29 12:10:34 -04:00
|
|
|
cogl_flush ();
|
2008-04-28 05:33:38 -04:00
|
|
|
|
2008-04-25 09:37:36 -04:00
|
|
|
eglWaitGL();
|
2010-02-27 04:42:42 -05:00
|
|
|
eglSwapBuffers (backend_egl->edpy, backend_egl->egl_surface);
|
2008-04-23 13:20:59 -04:00
|
|
|
}
|
|
|
|
|
2010-02-27 04:42:42 -05:00
|
|
|
static ClutterStageWindow *
|
2008-04-23 13:20:59 -04:00
|
|
|
clutter_backend_egl_create_stage (ClutterBackend *backend,
|
|
|
|
ClutterStage *wrapper,
|
|
|
|
GError **error)
|
|
|
|
{
|
|
|
|
ClutterBackendEGL *backend_egl = CLUTTER_BACKEND_EGL (backend);
|
2010-02-27 04:42:42 -05:00
|
|
|
ClutterStageEGL *stage_egl;
|
|
|
|
ClutterStageWindow *stage;
|
2008-04-23 13:20:59 -04:00
|
|
|
|
2010-02-27 04:42:42 -05:00
|
|
|
if (G_UNLIKELY (backend_egl->stage != NULL))
|
2008-04-23 13:20:59 -04:00
|
|
|
{
|
2010-02-27 04:42:42 -05:00
|
|
|
g_set_error (error, CLUTTER_INIT_ERROR,
|
|
|
|
CLUTTER_INIT_ERROR_BACKEND,
|
|
|
|
"The EGL native backend does not support multiple stages");
|
2008-04-23 13:20:59 -04:00
|
|
|
return backend_egl->stage;
|
2007-07-06 09:56:01 -04:00
|
|
|
}
|
|
|
|
|
2008-04-23 13:20:59 -04:00
|
|
|
stage = g_object_new (CLUTTER_TYPE_STAGE_EGL, NULL);
|
|
|
|
|
|
|
|
stage_egl = CLUTTER_STAGE_EGL (stage);
|
|
|
|
stage_egl->backend = backend_egl;
|
|
|
|
stage_egl->wrapper = wrapper;
|
|
|
|
|
2008-04-25 09:37:36 -04:00
|
|
|
backend_egl->stage = CLUTTER_ACTOR (stage_egl);
|
2008-04-23 13:20:59 -04:00
|
|
|
|
|
|
|
return stage;
|
2007-07-06 09:56:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_backend_egl_init_events (ClutterBackend *backend)
|
|
|
|
{
|
2010-02-27 04:42:42 -05:00
|
|
|
_clutter_events_egl_init (CLUTTER_BACKEND_EGL (backend));
|
2007-07-06 09:56:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static const GOptionEntry entries[] =
|
|
|
|
{
|
|
|
|
{ NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_backend_egl_finalize (GObject *gobject)
|
|
|
|
{
|
|
|
|
if (backend_singleton)
|
|
|
|
backend_singleton = NULL;
|
|
|
|
|
|
|
|
G_OBJECT_CLASS (clutter_backend_egl_parent_class)->finalize (gobject);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_backend_egl_dispose (GObject *gobject)
|
|
|
|
{
|
|
|
|
ClutterBackendEGL *backend_egl = CLUTTER_BACKEND_EGL (gobject);
|
2010-02-27 04:42:42 -05:00
|
|
|
ClutterStageEGL *stage_egl = CLUTTER_STAGE_EGL (backend_egl->stage);
|
2007-07-06 09:56:01 -04:00
|
|
|
|
2010-02-27 04:42:42 -05:00
|
|
|
_clutter_events_egl_uninit (backend_egl);
|
2007-07-06 09:56:01 -04:00
|
|
|
|
2010-02-27 04:42:42 -05:00
|
|
|
if (backend_egl->stage != NULL)
|
|
|
|
{
|
|
|
|
clutter_actor_destroy (CLUTTER_ACTOR (stage_egl->wrapper));
|
|
|
|
backend_egl->stage = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (backend_egl->egl_surface != EGL_NO_SURFACE)
|
|
|
|
{
|
|
|
|
eglDestroySurface (backend_egl->edpy, backend_egl->egl_surface);
|
|
|
|
backend_egl->egl_surface = EGL_NO_SURFACE;
|
|
|
|
}
|
|
|
|
|
2010-03-01 06:38:41 -05:00
|
|
|
if (backend_egl->fb_device_id != -1)
|
|
|
|
{
|
|
|
|
close (backend_egl->fb_device_id);
|
|
|
|
backend_egl->fb_device_id = -1;
|
|
|
|
}
|
|
|
|
|
2010-02-27 04:42:42 -05:00
|
|
|
if (backend_egl->egl_context != NULL)
|
2007-07-06 09:56:01 -04:00
|
|
|
{
|
2008-04-23 13:20:59 -04:00
|
|
|
eglDestroyContext (backend_egl->edpy, backend_egl->egl_context);
|
|
|
|
backend_egl->egl_context = NULL;
|
2007-07-06 09:56:01 -04:00
|
|
|
}
|
|
|
|
|
2007-10-09 09:56:29 -04:00
|
|
|
if (backend_egl->edpy)
|
|
|
|
{
|
|
|
|
eglTerminate (backend_egl->edpy);
|
2008-04-25 09:37:36 -04:00
|
|
|
backend_egl->edpy = 0;
|
2007-10-09 09:56:29 -04:00
|
|
|
}
|
|
|
|
|
2010-02-27 04:42:42 -05:00
|
|
|
if (backend_egl->event_timer != NULL)
|
2008-05-15 10:31:43 -04:00
|
|
|
{
|
|
|
|
g_timer_destroy (backend_egl->event_timer);
|
|
|
|
backend_egl->event_timer = NULL;
|
|
|
|
}
|
|
|
|
|
2007-07-06 09:56:01 -04:00
|
|
|
G_OBJECT_CLASS (clutter_backend_egl_parent_class)->dispose (gobject);
|
|
|
|
}
|
|
|
|
|
|
|
|
static GObject *
|
|
|
|
clutter_backend_egl_constructor (GType gtype,
|
|
|
|
guint n_params,
|
|
|
|
GObjectConstructParam *params)
|
|
|
|
{
|
|
|
|
GObjectClass *parent_class;
|
|
|
|
GObject *retval;
|
|
|
|
|
|
|
|
if (!backend_singleton)
|
|
|
|
{
|
|
|
|
parent_class = G_OBJECT_CLASS (clutter_backend_egl_parent_class);
|
|
|
|
retval = parent_class->constructor (gtype, n_params, params);
|
|
|
|
|
|
|
|
backend_singleton = CLUTTER_BACKEND_EGL (retval);
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_warning ("Attempting to create a new backend object. This should "
|
|
|
|
"never happen, so we return the singleton instance.");
|
|
|
|
|
|
|
|
return g_object_ref (backend_singleton);
|
|
|
|
}
|
|
|
|
|
2007-07-26 16:08:09 -04:00
|
|
|
static ClutterFeatureFlags
|
|
|
|
clutter_backend_egl_get_features (ClutterBackend *backend)
|
|
|
|
{
|
2008-04-23 13:20:59 -04:00
|
|
|
ClutterBackendEGL *backend_egl = CLUTTER_BACKEND_EGL (backend);
|
|
|
|
|
2010-02-27 04:42:42 -05:00
|
|
|
g_assert (backend_egl->egl_context != NULL);
|
|
|
|
|
2008-04-23 13:20:59 -04:00
|
|
|
CLUTTER_NOTE (BACKEND, "Checking features\n"
|
|
|
|
"GL_VENDOR: %s\n"
|
|
|
|
"GL_RENDERER: %s\n"
|
|
|
|
"GL_VERSION: %s\n"
|
|
|
|
"EGL_VENDOR: %s\n"
|
|
|
|
"EGL_VERSION: %s\n"
|
|
|
|
"EGL_EXTENSIONS: %s\n",
|
|
|
|
glGetString (GL_VENDOR),
|
|
|
|
glGetString (GL_RENDERER),
|
|
|
|
glGetString (GL_VERSION),
|
|
|
|
eglQueryString (backend_egl->edpy, EGL_VENDOR),
|
|
|
|
eglQueryString (backend_egl->edpy, EGL_VERSION),
|
|
|
|
eglQueryString (backend_egl->edpy, EGL_EXTENSIONS));
|
|
|
|
|
2007-07-26 16:08:09 -04:00
|
|
|
return CLUTTER_FEATURE_STAGE_STATIC;
|
|
|
|
}
|
|
|
|
|
2007-07-06 09:56:01 -04:00
|
|
|
static void
|
|
|
|
clutter_backend_egl_class_init (ClutterBackendEGLClass *klass)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
|
|
|
ClutterBackendClass *backend_class = CLUTTER_BACKEND_CLASS (klass);
|
|
|
|
|
|
|
|
gobject_class->constructor = clutter_backend_egl_constructor;
|
|
|
|
gobject_class->dispose = clutter_backend_egl_dispose;
|
|
|
|
gobject_class->finalize = clutter_backend_egl_finalize;
|
|
|
|
|
2008-06-25 09:05:59 -04:00
|
|
|
backend_class->pre_parse = clutter_backend_egl_pre_parse;
|
|
|
|
backend_class->post_parse = clutter_backend_egl_post_parse;
|
|
|
|
backend_class->init_events = clutter_backend_egl_init_events;
|
|
|
|
backend_class->create_stage = clutter_backend_egl_create_stage;
|
2010-02-27 04:42:42 -05:00
|
|
|
backend_class->create_context = clutter_backend_egl_create_context;
|
2008-06-25 09:05:59 -04:00
|
|
|
backend_class->ensure_context = clutter_backend_egl_ensure_context;
|
|
|
|
backend_class->redraw = clutter_backend_egl_redraw;
|
|
|
|
backend_class->get_features = clutter_backend_egl_get_features;
|
2007-07-06 09:56:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
clutter_backend_egl_init (ClutterBackendEGL *backend_egl)
|
|
|
|
{
|
|
|
|
ClutterBackend *backend = CLUTTER_BACKEND (backend_egl);
|
|
|
|
|
2007-08-02 05:58:18 -04:00
|
|
|
clutter_backend_set_resolution (backend, 96.0);
|
2007-07-06 09:56:01 -04:00
|
|
|
clutter_backend_set_double_click_time (backend, 250);
|
|
|
|
clutter_backend_set_double_click_distance (backend, 5);
|
2008-05-15 10:31:43 -04:00
|
|
|
|
|
|
|
backend_egl->event_timer = g_timer_new ();
|
2010-03-01 06:38:41 -05:00
|
|
|
|
|
|
|
backend_egl->fb_device_id = -1;
|
2007-07-06 09:56:01 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
GType
|
|
|
|
_clutter_backend_impl_get_type (void)
|
|
|
|
{
|
|
|
|
return clutter_backend_egl_get_type ();
|
|
|
|
}
|
|
|
|
|
2010-03-02 04:53:55 -05:00
|
|
|
/**
|
|
|
|
* clutter_egl_display:
|
|
|
|
*
|
|
|
|
* Retrieves the <structname>EGLDisplay</structname> used by Clutter
|
|
|
|
*
|
|
|
|
* Return value: the EGL display
|
|
|
|
*/
|
2007-07-06 09:56:01 -04:00
|
|
|
EGLDisplay
|
|
|
|
clutter_egl_display (void)
|
|
|
|
{
|
2007-07-09 17:59:01 -04:00
|
|
|
return backend_singleton->edpy;
|
2007-07-06 09:56:01 -04:00
|
|
|
}
|