diff --git a/cogl/Makefile.am b/cogl/Makefile.am
index 2f732bc0b..b62a2a526 100644
--- a/cogl/Makefile.am
+++ b/cogl/Makefile.am
@@ -376,11 +376,36 @@ endif
if SUPPORT_EGL_PLATFORM_WAYLAND
cogl_public_h += \
$(srcdir)/cogl-wayland-renderer.h
+cogl_sources_c += \
+ $(srcdir)/winsys/cogl-winsys-egl-wayland.c \
+ $(srcdir)/winsys/cogl-winsys-egl-wayland-private.h
endif
if SUPPORT_EGL_PLATFORM_KMS
cogl_sources_c += \
$(srcdir)/winsys/cogl-winsys-kms.c \
- $(srcdir)/winsys/cogl-winsys-kms.h
+ $(srcdir)/winsys/cogl-winsys-kms.h \
+ $(srcdir)/winsys/cogl-winsys-egl-kms.c \
+ $(srcdir)/winsys/cogl-winsys-egl-kms-private.h
+endif
+if SUPPORT_EGL_PLATFORM_POWERVR_X11
+cogl_sources_c += \
+ $(srcdir)/winsys/cogl-winsys-egl-x11.c \
+ $(srcdir)/winsys/cogl-winsys-egl-x11-private.h
+endif
+if SUPPORT_EGL_PLATFORM_POWERVR_NULL
+cogl_sources_c += \
+ $(srcdir)/winsys/cogl-winsys-egl-null.c \
+ $(srcdir)/winsys/cogl-winsys-egl-null-private.h
+endif
+if SUPPORT_EGL_PLATFORM_GDL
+cogl_sources_c += \
+ $(srcdir)/winsys/cogl-winsys-egl-gdl.c \
+ $(srcdir)/winsys/cogl-winsys-egl-gdl-private.h
+endif
+if SUPPORT_EGL_PLATFORM_ANDROID
+cogl_sources_c += \
+ $(srcdir)/winsys/cogl-winsys-egl-android.c \
+ $(srcdir)/winsys/cogl-winsys-egl-android-private.h
endif
if SUPPORT_EGL
cogl_sources_c += \
diff --git a/cogl/cogl-renderer.c b/cogl/cogl-renderer.c
index 2e2720921..aed8dc943 100644
--- a/cogl/cogl-renderer.c
+++ b/cogl/cogl-renderer.c
@@ -43,11 +43,27 @@
#include "cogl-display-private.h"
#include "cogl-winsys-private.h"
#include "cogl-winsys-stub-private.h"
-#ifdef COGL_HAS_EGL_SUPPORT
-#include "cogl-winsys-egl-private.h"
-#endif
#include "cogl-config-private.h"
+#ifdef COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT
+#include "cogl-winsys-egl-x11-private.h"
+#endif
+#ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT
+#include "cogl-winsys-egl-wayland-private.h"
+#endif
+#ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT
+#include "cogl-winsys-egl-kms-private.h"
+#endif
+#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
+#include "cogl-winsys-egl-gdl-private.h"
+#endif
+#ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT
+#include "cogl-winsys-egl-android-private.h"
+#endif
+#ifdef COGL_HAS_EGL_PLATFORM_POWERVR_NULL_SUPPORT
+#include "cogl-winsys-egl-null-private.h"
+#endif
+
#if COGL_HAS_XLIB_SUPPORT
#include "cogl-xlib-renderer.h"
#endif
@@ -66,8 +82,23 @@ static CoglWinsysVtableGetter _cogl_winsys_vtable_getters[] =
#ifdef COGL_HAS_GLX_SUPPORT
_cogl_winsys_glx_get_vtable,
#endif
-#ifdef COGL_HAS_EGL_SUPPORT
- _cogl_winsys_egl_get_vtable,
+#ifdef COGL_HAS_EGL_PLATFORM_POWERVR_X11_SUPPORT
+ _cogl_winsys_egl_x11_get_vtable,
+#endif
+#ifdef COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT
+ _cogl_winsys_egl_wayland_get_vtable,
+#endif
+#ifdef COGL_HAS_EGL_PLATFORM_KMS_SUPPORT
+ _cogl_winsys_egl_kms_get_vtable,
+#endif
+#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
+ _cogl_winsys_egl_gdl_get_vtable,
+#endif
+#ifdef COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT
+ _cogl_winsys_egl_android_get_vtable,
+#endif
+#ifdef COGL_HAS_EGL_PLATFORM_POWERVR_NULL_SUPPORT
+ _cogl_winsys_egl_null_get_vtable,
#endif
#ifdef COGL_HAS_WGL_SUPPORT
_cogl_winsys_wgl_get_vtable,
diff --git a/cogl/cogl-renderer.h b/cogl/cogl-renderer.h
index 15c0ff4b6..9f225f237 100644
--- a/cogl/cogl-renderer.h
+++ b/cogl/cogl-renderer.h
@@ -77,7 +77,12 @@ typedef enum
COGL_WINSYS_ID_ANY,
COGL_WINSYS_ID_STUB,
COGL_WINSYS_ID_GLX,
- COGL_WINSYS_ID_EGL,
+ COGL_WINSYS_ID_EGL_X11,
+ COGL_WINSYS_ID_EGL_NULL,
+ COGL_WINSYS_ID_EGL_GDL,
+ COGL_WINSYS_ID_EGL_WAYLAND,
+ COGL_WINSYS_ID_EGL_KMS,
+ COGL_WINSYS_ID_EGL_ANDROID,
COGL_WINSYS_ID_WGL
} CoglWinsysID;
diff --git a/cogl/winsys/cogl-winsys-egl-android-private.h b/cogl/winsys/cogl-winsys-egl-android-private.h
new file mode 100644
index 000000000..571e74dee
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-egl-android-private.h
@@ -0,0 +1,32 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see .
+ *
+ *
+ */
+
+#ifndef __COGL_WINSYS_EGL_ANDROID_PRIVATE_H
+#define __COGL_WINSYS_EGL_ANDROID_PRIVATE_H
+
+#include "cogl-winsys-private.h"
+
+const CoglWinsysVtable *
+_cogl_winsys_egl_android_get_vtable (void);
+
+#endif /* __COGL_WINSYS_EGL_ANDROID_PRIVATE_H */
diff --git a/cogl/winsys/cogl-winsys-egl-android.c b/cogl/winsys/cogl-winsys-egl-android.c
new file mode 100644
index 000000000..e4bdea53a
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-egl-android.c
@@ -0,0 +1,55 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * .
+ *
+ *
+ * Authors:
+ * Robert Bragg
+ * Neil Roberts
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl-winsys-egl-android-private.h"
+#include "cogl-winsys-egl-private.h"
+
+const CoglWinsysVtable *
+_cogl_winsys_egl_android_get_vtable (void)
+{
+ static gboolean vtable_inited = FALSE;
+ static CoglWinsysVtable vtable;
+
+ if (!vtable_inited)
+ {
+ /* The EGL_ANDROID winsys is a subclass of the EGL winsys so we
+ start by copying its vtable */
+
+ vtable = *_cogl_winsys_egl_get_vtable ();
+
+ vtable.id = COGL_WINSYS_ID_EGL_ANDROID;
+ vtable.name = "EGL_ANDROID";
+
+ vtable_inited = TRUE;
+ }
+
+ return &vtable;
+}
diff --git a/cogl/winsys/cogl-winsys-egl-gdl-private.h b/cogl/winsys/cogl-winsys-egl-gdl-private.h
new file mode 100644
index 000000000..8db580427
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-egl-gdl-private.h
@@ -0,0 +1,32 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see .
+ *
+ *
+ */
+
+#ifndef __COGL_WINSYS_EGL_GDL_PRIVATE_H
+#define __COGL_WINSYS_EGL_GDL_PRIVATE_H
+
+#include "cogl-winsys-private.h"
+
+const CoglWinsysVtable *
+_cogl_winsys_egl_gdl_get_vtable (void);
+
+#endif /* __COGL_WINSYS_EGL_GDL_PRIVATE_H */
diff --git a/cogl/winsys/cogl-winsys-egl-gdl.c b/cogl/winsys/cogl-winsys-egl-gdl.c
new file mode 100644
index 000000000..407503573
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-egl-gdl.c
@@ -0,0 +1,55 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * .
+ *
+ *
+ * Authors:
+ * Robert Bragg
+ * Neil Roberts
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl-winsys-egl-gdl-private.h"
+#include "cogl-winsys-egl-private.h"
+
+const CoglWinsysVtable *
+_cogl_winsys_egl_gdl_get_vtable (void)
+{
+ static gboolean vtable_inited = FALSE;
+ static CoglWinsysVtable vtable;
+
+ if (!vtable_inited)
+ {
+ /* The EGL_GDL winsys is a subclass of the EGL winsys so we
+ start by copying its vtable */
+
+ vtable = *_cogl_winsys_egl_get_vtable ();
+
+ vtable.id = COGL_WINSYS_ID_EGL_GDL;
+ vtable.name = "EGL_GDL";
+
+ vtable_inited = TRUE;
+ }
+
+ return &vtable;
+}
diff --git a/cogl/winsys/cogl-winsys-egl-kms-private.h b/cogl/winsys/cogl-winsys-egl-kms-private.h
new file mode 100644
index 000000000..0dec2d965
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-egl-kms-private.h
@@ -0,0 +1,32 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see .
+ *
+ *
+ */
+
+#ifndef __COGL_WINSYS_EGL_KMS_PRIVATE_H
+#define __COGL_WINSYS_EGL_KMS_PRIVATE_H
+
+#include "cogl-winsys-private.h"
+
+const CoglWinsysVtable *
+_cogl_winsys_egl_kms_get_vtable (void);
+
+#endif /* __COGL_WINSYS_EGL_KMS_PRIVATE_H */
diff --git a/cogl/winsys/cogl-winsys-egl-kms.c b/cogl/winsys/cogl-winsys-egl-kms.c
new file mode 100644
index 000000000..0229e0fab
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-egl-kms.c
@@ -0,0 +1,55 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * .
+ *
+ *
+ * Authors:
+ * Robert Bragg
+ * Neil Roberts
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl-winsys-egl-kms-private.h"
+#include "cogl-winsys-egl-private.h"
+
+const CoglWinsysVtable *
+_cogl_winsys_egl_kms_get_vtable (void)
+{
+ static gboolean vtable_inited = FALSE;
+ static CoglWinsysVtable vtable;
+
+ if (!vtable_inited)
+ {
+ /* The EGL_KMS winsys is a subclass of the EGL winsys so we
+ start by copying its vtable */
+
+ vtable = *_cogl_winsys_egl_get_vtable ();
+
+ vtable.id = COGL_WINSYS_ID_EGL_KMS;
+ vtable.name = "EGL_KMS";
+
+ vtable_inited = TRUE;
+ }
+
+ return &vtable;
+}
diff --git a/cogl/winsys/cogl-winsys-egl-null-private.h b/cogl/winsys/cogl-winsys-egl-null-private.h
new file mode 100644
index 000000000..c125236ec
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-egl-null-private.h
@@ -0,0 +1,32 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see .
+ *
+ *
+ */
+
+#ifndef __COGL_WINSYS_EGL_NULL_PRIVATE_H
+#define __COGL_WINSYS_EGL_NULL_PRIVATE_H
+
+#include "cogl-winsys-private.h"
+
+const CoglWinsysVtable *
+_cogl_winsys_egl_null_get_vtable (void);
+
+#endif /* __COGL_WINSYS_EGL_NULL_PRIVATE_H */
diff --git a/cogl/winsys/cogl-winsys-egl-null.c b/cogl/winsys/cogl-winsys-egl-null.c
new file mode 100644
index 000000000..a3c1f7914
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-egl-null.c
@@ -0,0 +1,55 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * .
+ *
+ *
+ * Authors:
+ * Robert Bragg
+ * Neil Roberts
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl-winsys-egl-null-private.h"
+#include "cogl-winsys-egl-private.h"
+
+const CoglWinsysVtable *
+_cogl_winsys_egl_null_get_vtable (void)
+{
+ static gboolean vtable_inited = FALSE;
+ static CoglWinsysVtable vtable;
+
+ if (!vtable_inited)
+ {
+ /* The EGL_NULL winsys is a subclass of the EGL winsys so we
+ start by copying its vtable */
+
+ vtable = *_cogl_winsys_egl_get_vtable ();
+
+ vtable.id = COGL_WINSYS_ID_EGL_NULL;
+ vtable.name = "EGL_NULL";
+
+ vtable_inited = TRUE;
+ }
+
+ return &vtable;
+}
diff --git a/cogl/winsys/cogl-winsys-egl-wayland-private.h b/cogl/winsys/cogl-winsys-egl-wayland-private.h
new file mode 100644
index 000000000..870047cab
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-egl-wayland-private.h
@@ -0,0 +1,32 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see .
+ *
+ *
+ */
+
+#ifndef __COGL_WINSYS_EGL_WAYLAND_PRIVATE_H
+#define __COGL_WINSYS_EGL_WAYLAND_PRIVATE_H
+
+#include "cogl-winsys-private.h"
+
+const CoglWinsysVtable *
+_cogl_winsys_egl_wayland_get_vtable (void);
+
+#endif /* __COGL_WINSYS_EGL_WAYLAND_PRIVATE_H */
diff --git a/cogl/winsys/cogl-winsys-egl-wayland.c b/cogl/winsys/cogl-winsys-egl-wayland.c
new file mode 100644
index 000000000..cb4766e80
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-egl-wayland.c
@@ -0,0 +1,55 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * .
+ *
+ *
+ * Authors:
+ * Robert Bragg
+ * Neil Roberts
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl-winsys-egl-wayland-private.h"
+#include "cogl-winsys-egl-private.h"
+
+const CoglWinsysVtable *
+_cogl_winsys_egl_wayland_get_vtable (void)
+{
+ static gboolean vtable_inited = FALSE;
+ static CoglWinsysVtable vtable;
+
+ if (!vtable_inited)
+ {
+ /* The EGL_WAYLAND winsys is a subclass of the EGL winsys so we
+ start by copying its vtable */
+
+ vtable = *_cogl_winsys_egl_get_vtable ();
+
+ vtable.id = COGL_WINSYS_ID_EGL_WAYLAND;
+ vtable.name = "EGL_WAYLAND";
+
+ vtable_inited = TRUE;
+ }
+
+ return &vtable;
+}
diff --git a/cogl/winsys/cogl-winsys-egl-x11-private.h b/cogl/winsys/cogl-winsys-egl-x11-private.h
new file mode 100644
index 000000000..8438a9fb0
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-egl-x11-private.h
@@ -0,0 +1,32 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see .
+ *
+ *
+ */
+
+#ifndef __COGL_WINSYS_EGL_X11_PRIVATE_H
+#define __COGL_WINSYS_EGL_X11_PRIVATE_H
+
+#include "cogl-winsys-private.h"
+
+const CoglWinsysVtable *
+_cogl_winsys_egl_x11_get_vtable (void);
+
+#endif /* __COGL_WINSYS_EGL_X11_PRIVATE_H */
diff --git a/cogl/winsys/cogl-winsys-egl-x11.c b/cogl/winsys/cogl-winsys-egl-x11.c
new file mode 100644
index 000000000..c8991bafb
--- /dev/null
+++ b/cogl/winsys/cogl-winsys-egl-x11.c
@@ -0,0 +1,55 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * .
+ *
+ *
+ * Authors:
+ * Robert Bragg
+ * Neil Roberts
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl-winsys-egl-x11-private.h"
+#include "cogl-winsys-egl-private.h"
+
+const CoglWinsysVtable *
+_cogl_winsys_egl_x11_get_vtable (void)
+{
+ static gboolean vtable_inited = FALSE;
+ static CoglWinsysVtable vtable;
+
+ if (!vtable_inited)
+ {
+ /* The EGL_X11 winsys is a subclass of the EGL winsys so we
+ start by copying its vtable */
+
+ vtable = *_cogl_winsys_egl_get_vtable ();
+
+ vtable.id = COGL_WINSYS_ID_EGL_X11;
+ vtable.name = "EGL_X11";
+
+ vtable_inited = TRUE;
+ }
+
+ return &vtable;
+}
diff --git a/cogl/winsys/cogl-winsys-egl.c b/cogl/winsys/cogl-winsys-egl.c
index 895a8d84f..15f9e2ebb 100644
--- a/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/winsys/cogl-winsys-egl.c
@@ -1774,8 +1774,9 @@ _cogl_winsys_texture_pixmap_x11_get_texture (CoglTexturePixmapX11 *tex_pixmap)
static CoglWinsysVtable _cogl_winsys_vtable =
{
- .id = COGL_WINSYS_ID_EGL,
- .name = "EGL",
+ /* This winsys is only used as a base for the EGL-platform
+ winsys's so it does not have an ID or a name */
+
.renderer_get_proc_address = _cogl_winsys_renderer_get_proc_address,
.renderer_connect = _cogl_winsys_renderer_connect,
.renderer_disconnect = _cogl_winsys_renderer_disconnect,