summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am89
-rw-r--r--TODO25
-rw-r--r--cogl.pc.in15
-rw-r--r--cogl/Makefile.am161
-rw-r--r--cogl/cogl-bitmap-fallback.c (renamed from common/cogl-bitmap-fallback.c)0
-rw-r--r--cogl/cogl-bitmap-pixbuf.c (renamed from common/cogl-bitmap-pixbuf.c)0
-rw-r--r--cogl/cogl-bitmap-private.h (renamed from common/cogl-bitmap-private.h)0
-rw-r--r--cogl/cogl-bitmap.c (renamed from common/cogl-bitmap.c)0
-rw-r--r--cogl/cogl-bitmap.h (renamed from cogl-bitmap.h)0
-rw-r--r--cogl/cogl-blend-string.c (renamed from common/cogl-blend-string.c)0
-rw-r--r--cogl/cogl-blend-string.h (renamed from common/cogl-blend-string.h)0
-rw-r--r--cogl/cogl-clip-stack.c (renamed from common/cogl-clip-stack.c)0
-rw-r--r--cogl/cogl-clip-stack.h (renamed from common/cogl-clip-stack.h)0
-rw-r--r--cogl/cogl-color.c (renamed from common/cogl-color.c)0
-rw-r--r--cogl/cogl-color.h (renamed from cogl-color.h)0
-rw-r--r--cogl/cogl-context.c (renamed from common/cogl-context.c)0
-rw-r--r--cogl/cogl-context.h (renamed from common/cogl-context.h)0
-rw-r--r--cogl/cogl-current-matrix.c (renamed from common/cogl-current-matrix.c)0
-rw-r--r--cogl/cogl-current-matrix.h (renamed from common/cogl-current-matrix.h)0
-rw-r--r--cogl/cogl-debug.c (renamed from common/cogl-debug.c)0
-rw-r--r--cogl/cogl-debug.h (renamed from cogl-debug.h)0
-rw-r--r--cogl/cogl-deprecated.h (renamed from cogl-deprecated.h)0
-rw-r--r--cogl/cogl-enum-types.c.in (renamed from common/cogl-enum-types.c.in)0
-rw-r--r--cogl/cogl-enum-types.h.in (renamed from common/cogl-enum-types.h.in)0
-rw-r--r--cogl/cogl-fixed.c (renamed from common/cogl-fixed.c)0
-rw-r--r--cogl/cogl-fixed.h (renamed from cogl-fixed.h)0
-rw-r--r--cogl/cogl-handle.h (renamed from common/cogl-handle.h)0
-rw-r--r--cogl/cogl-internal.h (renamed from common/cogl-internal.h)0
-rw-r--r--cogl/cogl-material-private.h (renamed from common/cogl-material-private.h)0
-rw-r--r--cogl/cogl-material.c (renamed from common/cogl-material.c)0
-rw-r--r--cogl/cogl-material.h (renamed from cogl-material.h)0
-rw-r--r--cogl/cogl-matrix-stack.c (renamed from common/cogl-matrix-stack.c)0
-rw-r--r--cogl/cogl-matrix-stack.h (renamed from common/cogl-matrix-stack.h)3
-rw-r--r--cogl/cogl-matrix.c (renamed from common/cogl-matrix.c)0
-rw-r--r--cogl/cogl-matrix.h (renamed from cogl-matrix.h)0
-rw-r--r--cogl/cogl-offscreen.h (renamed from cogl-offscreen.h)0
-rw-r--r--cogl/cogl-path.h (renamed from cogl-path.h)0
-rw-r--r--cogl/cogl-primitives.c (renamed from common/cogl-primitives.c)0
-rw-r--r--cogl/cogl-primitives.h (renamed from common/cogl-primitives.h)6
-rw-r--r--cogl/cogl-shader.h (renamed from cogl-shader.h)0
-rw-r--r--cogl/cogl-texture-driver.h (renamed from common/cogl-texture-driver.h)0
-rw-r--r--cogl/cogl-texture-private.h (renamed from common/cogl-texture-private.h)0
-rw-r--r--cogl/cogl-texture.c (renamed from common/cogl-texture.c)0
-rw-r--r--cogl/cogl-texture.h (renamed from cogl-texture.h)0
-rw-r--r--cogl/cogl-types.h (renamed from cogl-types.h)0
-rw-r--r--cogl/cogl-util.c (renamed from common/cogl-util.c)0
-rw-r--r--cogl/cogl-util.h (renamed from common/cogl-util.h)0
-rw-r--r--cogl/cogl-vertex-buffer-private.h (renamed from common/cogl-vertex-buffer-private.h)0
-rw-r--r--cogl/cogl-vertex-buffer.c (renamed from common/cogl-vertex-buffer.c)0
-rw-r--r--cogl/cogl-vertex-buffer.h (renamed from cogl-vertex-buffer.h)0
-rw-r--r--cogl/cogl.c (renamed from common/cogl.c)35
-rw-r--r--cogl/cogl.h.in (renamed from cogl.h.in)2
-rw-r--r--cogl/cogl.pc.in17
-rw-r--r--cogl/driver/Makefile.am7
-rw-r--r--cogl/driver/gl/Makefile.am39
-rw-r--r--cogl/driver/gl/cogl-context-driver.c (renamed from gl/cogl-context-driver.c)0
-rw-r--r--cogl/driver/gl/cogl-context-driver.h (renamed from gl/cogl-context-driver.h)0
-rw-r--r--cogl/driver/gl/cogl-defines.h.in (renamed from gl/cogl-defines.h.in)0
-rw-r--r--cogl/driver/gl/cogl-fbo.c (renamed from gl/cogl-fbo.c)0
-rw-r--r--cogl/driver/gl/cogl-fbo.h (renamed from gl/cogl-fbo.h)0
-rw-r--r--cogl/driver/gl/cogl-primitives.c (renamed from gl/cogl-primitives.c)0
-rw-r--r--cogl/driver/gl/cogl-program.c (renamed from gl/cogl-program.c)0
-rw-r--r--cogl/driver/gl/cogl-program.h (renamed from gl/cogl-program.h)0
-rw-r--r--cogl/driver/gl/cogl-shader-private.h (renamed from gl/cogl-shader-private.h)0
-rw-r--r--cogl/driver/gl/cogl-shader.c (renamed from gl/cogl-shader.c)0
-rw-r--r--cogl/driver/gl/cogl-texture-driver.c (renamed from gl/cogl-texture-driver.c)0
-rw-r--r--cogl/driver/gl/cogl.c (renamed from gl/cogl.c)72
-rw-r--r--cogl/driver/gles/Makefile.am62
-rw-r--r--cogl/driver/gles/cogl-context-driver.c (renamed from gles/cogl-context-driver.c)0
-rw-r--r--cogl/driver/gles/cogl-context-driver.h (renamed from gles/cogl-context-driver.h)0
-rw-r--r--cogl/driver/gles/cogl-defines.h.in (renamed from gles/cogl-defines.h.in)0
-rw-r--r--cogl/driver/gles/cogl-fbo.c (renamed from gles/cogl-fbo.c)0
-rw-r--r--cogl/driver/gles/cogl-fbo.h (renamed from gles/cogl-fbo.h)0
-rw-r--r--cogl/driver/gles/cogl-fixed-fragment-shader.glsl (renamed from gles/cogl-fixed-fragment-shader.glsl)0
-rw-r--r--cogl/driver/gles/cogl-fixed-vertex-shader.glsl (renamed from gles/cogl-fixed-vertex-shader.glsl)0
-rw-r--r--cogl/driver/gles/cogl-gles2-wrapper.c (renamed from gles/cogl-gles2-wrapper.c)0
-rw-r--r--cogl/driver/gles/cogl-gles2-wrapper.h (renamed from gles/cogl-gles2-wrapper.h)0
-rw-r--r--cogl/driver/gles/cogl-primitives.c (renamed from gles/cogl-primitives.c)0
-rw-r--r--cogl/driver/gles/cogl-program.c (renamed from gles/cogl-program.c)0
-rw-r--r--cogl/driver/gles/cogl-program.h (renamed from gles/cogl-program.h)0
-rw-r--r--cogl/driver/gles/cogl-shader-private.h (renamed from gles/cogl-shader-private.h)0
-rw-r--r--cogl/driver/gles/cogl-shader.c (renamed from gles/cogl-shader.c)0
-rw-r--r--cogl/driver/gles/cogl-texture-driver.c (renamed from gles/cogl-texture-driver.c)0
-rw-r--r--cogl/driver/gles/cogl-util.c (renamed from gles/cogl-util.c)0
-rw-r--r--cogl/driver/gles/cogl-util.h (renamed from gles/cogl-util.h)0
-rw-r--r--cogl/driver/gles/cogl.c (renamed from gles/cogl.c)10
-rw-r--r--cogl/driver/gles/stringify.sh (renamed from gles/stringify.sh)0
-rw-r--r--cogl/stb_image.c (renamed from common/stb_image.c)0
-rw-r--r--cogl/winsys/Makefile.am43
-rw-r--r--cogl/winsys/cogl-eglnative.c35
-rw-r--r--cogl/winsys/cogl-eglx.c35
-rw-r--r--cogl/winsys/cogl-fruity.c35
-rw-r--r--cogl/winsys/cogl-glx.c78
-rw-r--r--cogl/winsys/cogl-osx.c35
-rw-r--r--cogl/winsys/cogl-sdl.c35
-rw-r--r--cogl/winsys/cogl-win32.c35
-rw-r--r--cogl/winsys/cogl-winsys.h30
-rw-r--r--common/Makefile.am96
-rw-r--r--doc/reference/cogl/Makefile.am11
99 files changed, 687 insertions, 324 deletions
diff --git a/Makefile.am b/Makefile.am
index 58f762fa..e13c1b48 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,88 +1 @@
-include $(top_srcdir)/build/autotools/Makefile.am.silent
-
-NULL =
-
-SUBDIRS = common $(CLUTTER_COGL)
-
-BUILT_SOURCES = cogl.h
-
-EXTRA_DIST = cogl.h.in cogl.pc.in
-
-DIST_SUBDIRS = common gl gles
-
-pc_files = \
- cogl-$(CLUTTER_COGL)-$(CLUTTER_API_VERSION).pc \
- cogl-$(CLUTTER_API_VERSION).pc
-
-cogl-$(CLUTTER_API_VERSION).pc: cogl.pc
- $(QUIET_GEN)cp -f $< $(@F)
-
-cogl-$(CLUTTER_COGL)-$(CLUTTER_API_VERSION).pc: cogl.pc
- $(QUIET_GEN)cp -f $< $(@F)
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = $(pc_files)
-
-CLEANFILES = $(pc_files)
-
-AM_CPPFLAGS = $(CLUTTER_CFLAGS) $(CLUTTER_DEBUG_CFLAGS) $(MAINTAINER_CFLAGS)
-
-# COGL installed headers
-cogl_headers = \
- $(top_srcdir)/clutter/cogl/cogl-bitmap.h \
- $(top_srcdir)/clutter/cogl/cogl-color.h \
- $(top_srcdir)/clutter/cogl/cogl-debug.h \
- $(top_srcdir)/clutter/cogl/cogl-deprecated.h \
- $(top_srcdir)/clutter/cogl/cogl-fixed.h \
- $(top_srcdir)/clutter/cogl/cogl-material.h \
- $(top_srcdir)/clutter/cogl/cogl-matrix.h \
- $(top_srcdir)/clutter/cogl/cogl-offscreen.h \
- $(top_srcdir)/clutter/cogl/cogl-path.h \
- $(top_srcdir)/clutter/cogl/cogl-shader.h \
- $(top_srcdir)/clutter/cogl/cogl-texture.h \
- $(top_srcdir)/clutter/cogl/cogl-types.h \
- $(top_srcdir)/clutter/cogl/cogl-vertex-buffer.h \
- $(top_builddir)/clutter/cogl/cogl-defines-@CLUTTER_COGL@.h \
- $(top_builddir)/clutter/cogl/cogl-enum-types.h \
- $(top_builddir)/clutter/cogl/cogl.h \
- $(NULL)
-
-# this is copied in from common/ to make cogl.h work, but we
-# need to clean it up ourselves once we're done
-DISTCLEANFILES = cogl-enum-types.h
-
-# HACK - gobject-introspection can't scan a library in another directory
-# so we create a libclutter-cogl.la that's just identical to the one
-# in the subdir
-noinst_LTLIBRARIES = libclutter-cogl.la
-libclutter_cogl_la_LIBADD = $(CLUTTER_COGL)/libclutter-cogl-$(CLUTTER_COGL).la
-libclutter_cogl_la_SOURCES = $(cogl_headers)
-
-coglincludedir = $(includedir)/clutter-@CLUTTER_API_VERSION@/cogl
-coglinclude_HEADERS = $(cogl_headers)
-
-if HAVE_INTROSPECTION
-Cogl-@CLUTTER_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libclutter-cogl.la
- $(QUIET_GEN)$(INTROSPECTION_SCANNER) -v \
- --namespace Cogl --nsversion=@CLUTTER_API_VERSION@ \
- -I$(top_srcdir)/clutter/cogl \
- -I$(top_srcdir)/clutter/cogl/common \
- -I$(top_srcdir)/clutter/cogl/@CLUTTER_COGL@ \
- -I$(top_builddir)/clutter \
- -DCLUTTER_COMPILATION \
- --c-include='cogl/cogl.h' \
- --include=GL-1.0 \
- --include=GObject-2.0 \
- --library=libclutter-cogl.la \
- --libtool="$(top_builddir)/libtool" \
- --pkg gobject-2.0 \
- --output $@ \
- $(cogl_headers)
-
-BUILT_GIRSOURCES = Cogl-@CLUTTER_API_VERSION@.gir
-
-girdir = $(datadir)/gir-1.0
-gir_DATA = $(BUILT_GIRSOURCES)
-
-CLEANFILES += $(BUILT_GIRSOURCES)
-endif
+SUBDIRS = cogl
diff --git a/TODO b/TODO
deleted file mode 100644
index e1e5d316..00000000
--- a/TODO
+++ /dev/null
@@ -1,25 +0,0 @@
-============================
-Cogl overhaul related tasks:
-============================
-
-MISC
-
-- implemenent a 1 to 1 mapping of COGL_FEATURE flags
- into CLUTTER_FEATURE flags before combining them
- into final clutter flags value (clutter-feature.c)
-
-TEXTURE
-
-- cogl_texture_get_data, cogl_texture_set_region in GLES
-
-- YUV texture format support (multitexturing + shader)
-
-FBO
-
-- add stencil, depth and other renderbuffers to fbos
-
-- cogl_offscreen_new_multisample
-
-- test cogl_offscreen_blit
-
-- add "filter" argument to cogl_offscreen_blit
diff --git a/cogl.pc.in b/cogl.pc.in
deleted file mode 100644
index 87196733..00000000
--- a/cogl.pc.in
+++ /dev/null
@@ -1,15 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-apiversion=@CLUTTER_API_VERSION@
-requires=@CLUTTER_REQUIRES@
-backend=@clutterbackend@
-cogl=@CLUTTER_COGL@
-
-Name: COGL
-Description: Clutter GL abstraction library (${cogl} backend)
-Version: @VERSION@
-Libs: -L${libdir} -lclutter-${backend}-${apiversion}
-Cflags: -I${includedir}/clutter-${apiversion}
-Requires: ${requires}
diff --git a/cogl/Makefile.am b/cogl/Makefile.am
new file mode 100644
index 00000000..e9be04ab
--- /dev/null
+++ b/cogl/Makefile.am
@@ -0,0 +1,161 @@
+include $(top_srcdir)/build/autotools/Makefile.am.silent
+
+NULL =
+
+SUBDIRS = winsys driver
+
+BUILT_SOURCES = cogl.h
+
+EXTRA_DIST = cogl.h.in cogl.pc.in
+
+pc_files = \
+ cogl-$(COGL_DRIVER)-$(CLUTTER_API_VERSION).pc \
+ cogl-$(CLUTTER_API_VERSION).pc
+
+cogl-$(CLUTTER_API_VERSION).pc: cogl.pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+cogl-$(COGL_DRIVER)-$(CLUTTER_API_VERSION).pc: cogl.pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = $(pc_files)
+
+CLEANFILES = $(pc_files)
+
+INCLUDES = \
+ -I$(top_srcdir) \
+ -I$(srcdir) \
+ -I$(srcdir)/.. \
+ -I$(srcdir)/winsys \
+ -I$(srcdir)/driver/$(COGL_DRIVER) \
+ -I. \
+ -I.. \
+ -DG_DISABLE_SINGLE_INCLUDES \
+ -DG_LOG_DOMAIN=\"Cogl-Core\" \
+ -DCLUTTER_COMPILATION
+
+cogl_public_h = \
+ $(srcdir)/cogl-bitmap.h \
+ $(srcdir)/cogl-color.h \
+ $(srcdir)/cogl-debug.h \
+ $(srcdir)/cogl-fixed.h \
+ $(srcdir)/cogl-material.h \
+ $(srcdir)/cogl-matrix.h \
+ $(srcdir)/cogl-offscreen.h \
+ $(srcdir)/cogl-path.h \
+ $(srcdir)/cogl-shader.h \
+ $(srcdir)/cogl-texture.h \
+ $(srcdir)/cogl-types.h \
+ $(srcdir)/cogl-vertex-buffer.h \
+ cogl.h \
+ $(NULL)
+
+cogl-enum-types.h: stamp-cogl-enum-types.h
+ @true
+stamp-cogl-enum-types.h: $(cogl_public_h) Makefile
+ $(QUIET_GEN)( $(GLIB_MKENUMS) \
+ --template $(srcdir)/cogl-enum-types.h.in \
+ $(cogl_public_h) ) > xgen-ceth \
+ && (cmp -s xgen-ceth cogl-enum-types.h || cp -f xgen-ceth cogl-enum-types.h) \
+ && rm -f xgen-ceth \
+ && echo timestamp > $(@F)
+
+cogl-enum-types.c: cogl-enum-types.h
+ $(QUIET_GEN)( $(GLIB_MKENUMS) \
+ --template $(srcdir)/cogl-enum-types.c.in \
+ $(cogl_public_h) ) > xgen-cetc \
+ && cp -f xgen-cetc cogl-enum-types.c \
+ && rm -f xgen-cetc
+
+BUILT_SOURCES += cogl-enum-types.h cogl-enum-types.c
+
+noinst_LTLIBRARIES = libclutter-cogl.la
+libclutter_cogl_la_CPPFLAGS = \
+ $(CLUTTER_CFLAGS) \
+ $(COGL_DEBUG_CFLAGS) \
+ $(CLUTTER_DEBUG_CFLAGS) \
+ $(MAINTAINER_CFLAGS)
+libclutter_cogl_la_LIBADD = \
+ -lm $(CLUTTER_LIBS) \
+ winsys/libclutter-cogl-winsys.la \
+ driver/$(COGL_DRIVER)/libclutter-cogl-driver.la
+# os/$(COGL_DRIVER)/libclutter-cogl-os.la
+libclutter_cogl_la_SOURCES = \
+ cogl-enum-types.h \
+ cogl-enum-types.c \
+ cogl-handle.h \
+ cogl-context.h \
+ cogl-context.c \
+ cogl-internal.h \
+ cogl.c \
+ cogl-util.h \
+ cogl-util.c \
+ cogl-bitmap-private.h \
+ cogl-bitmap.c \
+ cogl-bitmap-fallback.c \
+ cogl-current-matrix.c \
+ cogl-current-matrix.h \
+ cogl-primitives.h \
+ cogl-primitives.c \
+ cogl-bitmap-pixbuf.c \
+ cogl-clip-stack.h \
+ cogl-clip-stack.c \
+ cogl-fixed.c \
+ cogl-color.c \
+ cogl-vertex-buffer-private.h \
+ cogl-vertex-buffer.c \
+ cogl-matrix.c \
+ cogl-matrix-stack.c \
+ cogl-matrix-stack.h \
+ cogl-material.c \
+ cogl-material-private.h \
+ cogl-blend-string.c \
+ cogl-blend-string.h \
+ cogl-debug.c \
+ cogl-texture-private.h \
+ cogl-texture-driver.h \
+ cogl-texture.c \
+ $(NULL)
+
+EXTRA_DIST += stb_image.c cogl-enum-types.h.in cogl-enum-types.c.in
+CLEANFILES += stamp-cogl-enum-types.h
+DISTCLEANFILES = cogl-enum-types.h cogl-enum-types.c
+
+# COGL installed headers
+cogl_headers = \
+ $(cogl_public_h) \
+ cogl-deprecated.h \
+ cogl-defines-@COGL_DRIVER@.h \
+ cogl-enum-types.h \
+ $(NULL)
+
+coglincludedir = $(includedir)/clutter-@CLUTTER_API_VERSION@/cogl
+coglinclude_HEADERS = $(cogl_headers)
+
+if HAVE_INTROSPECTION
+Cogl-@CLUTTER_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libclutter-cogl.la
+ $(QUIET_GEN)$(INTROSPECTION_SCANNER) -v \
+ --namespace Cogl --nsversion=@CLUTTER_API_VERSION@ \
+ -I$(srcdir) \
+ -I$(srcdir)/.. \
+ -I$(srcdir)/winsys \
+ -I$(srcdir)/driver/@COGL_DRIVER@ \
+ -DCLUTTER_COMPILATION \
+ --c-include='cogl/cogl.h' \
+ --include=GL-1.0 \
+ --include=GObject-2.0 \
+ --library=libclutter-cogl.la \
+ --libtool="$(top_builddir)/libtool" \
+ --pkg gobject-2.0 \
+ --output $@ \
+ $(cogl_headers)
+
+BUILT_GIRSOURCES = Cogl-@CLUTTER_API_VERSION@.gir
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(BUILT_GIRSOURCES)
+
+CLEANFILES += $(BUILT_GIRSOURCES)
+endif
+
diff --git a/common/cogl-bitmap-fallback.c b/cogl/cogl-bitmap-fallback.c
index ddff6ea4..ddff6ea4 100644
--- a/common/cogl-bitmap-fallback.c
+++ b/cogl/cogl-bitmap-fallback.c
diff --git a/common/cogl-bitmap-pixbuf.c b/cogl/cogl-bitmap-pixbuf.c
index 1b75cd0b..1b75cd0b 100644
--- a/common/cogl-bitmap-pixbuf.c
+++ b/cogl/cogl-bitmap-pixbuf.c
diff --git a/common/cogl-bitmap-private.h b/cogl/cogl-bitmap-private.h
index b6e42573..b6e42573 100644
--- a/common/cogl-bitmap-private.h
+++ b/cogl/cogl-bitmap-private.h
diff --git a/common/cogl-bitmap.c b/cogl/cogl-bitmap.c
index 3dc7fd53..3dc7fd53 100644
--- a/common/cogl-bitmap.c
+++ b/cogl/cogl-bitmap.c
diff --git a/cogl-bitmap.h b/cogl/cogl-bitmap.h
index a26c0c2c..a26c0c2c 100644
--- a/cogl-bitmap.h
+++ b/cogl/cogl-bitmap.h
diff --git a/common/cogl-blend-string.c b/cogl/cogl-blend-string.c
index b4cc724b..b4cc724b 100644
--- a/common/cogl-blend-string.c
+++ b/cogl/cogl-blend-string.c
diff --git a/common/cogl-blend-string.h b/cogl/cogl-blend-string.h
index 8469cf5e..8469cf5e 100644
--- a/common/cogl-blend-string.h
+++ b/cogl/cogl-blend-string.h
diff --git a/common/cogl-clip-stack.c b/cogl/cogl-clip-stack.c
index 9efa5c22..9efa5c22 100644
--- a/common/cogl-clip-stack.c
+++ b/cogl/cogl-clip-stack.c
diff --git a/common/cogl-clip-stack.h b/cogl/cogl-clip-stack.h
index 324097b1..324097b1 100644
--- a/common/cogl-clip-stack.h
+++ b/cogl/cogl-clip-stack.h
diff --git a/common/cogl-color.c b/cogl/cogl-color.c
index 25a1bdaf..25a1bdaf 100644
--- a/common/cogl-color.c
+++ b/cogl/cogl-color.c
diff --git a/cogl-color.h b/cogl/cogl-color.h
index 6ade2594..6ade2594 100644
--- a/cogl-color.h
+++ b/cogl/cogl-color.h
diff --git a/common/cogl-context.c b/cogl/cogl-context.c
index b42e3e50..b42e3e50 100644
--- a/common/cogl-context.c
+++ b/cogl/cogl-context.c
diff --git a/common/cogl-context.h b/cogl/cogl-context.h
index e51db6e9..e51db6e9 100644
--- a/common/cogl-context.h
+++ b/cogl/cogl-context.h
diff --git a/common/cogl-current-matrix.c b/cogl/cogl-current-matrix.c
index 217eb2df..217eb2df 100644
--- a/common/cogl-current-matrix.c
+++ b/cogl/cogl-current-matrix.c
diff --git a/common/cogl-current-matrix.h b/cogl/cogl-current-matrix.h
index eb246488..eb246488 100644
--- a/common/cogl-current-matrix.h
+++ b/cogl/cogl-current-matrix.h
diff --git a/common/cogl-debug.c b/cogl/cogl-debug.c
index 6ca99c5b..6ca99c5b 100644
--- a/common/cogl-debug.c
+++ b/cogl/cogl-debug.c
diff --git a/cogl-debug.h b/cogl/cogl-debug.h
index a1e5a358..a1e5a358 100644
--- a/cogl-debug.h
+++ b/cogl/cogl-debug.h
diff --git a/cogl-deprecated.h b/cogl/cogl-deprecated.h
index 24dc5b28..24dc5b28 100644
--- a/cogl-deprecated.h
+++ b/cogl/cogl-deprecated.h
diff --git a/common/cogl-enum-types.c.in b/cogl/cogl-enum-types.c.in
index 157180df..157180df 100644
--- a/common/cogl-enum-types.c.in
+++ b/cogl/cogl-enum-types.c.in
diff --git a/common/cogl-enum-types.h.in b/cogl/cogl-enum-types.h.in
index 23d705de..23d705de 100644
--- a/common/cogl-enum-types.h.in
+++ b/cogl/cogl-enum-types.h.in
diff --git a/common/cogl-fixed.c b/cogl/cogl-fixed.c
index 13a96765..13a96765 100644
--- a/common/cogl-fixed.c
+++ b/cogl/cogl-fixed.c
diff --git a/cogl-fixed.h b/cogl/cogl-fixed.h
index 904913ea..904913ea 100644
--- a/cogl-fixed.h
+++ b/cogl/cogl-fixed.h
diff --git a/common/cogl-handle.h b/cogl/cogl-handle.h
index 6caee0e7..6caee0e7 100644
--- a/common/cogl-handle.h
+++ b/cogl/cogl-handle.h
diff --git a/common/cogl-internal.h b/cogl/cogl-internal.h
index b488c563..b488c563 100644
--- a/common/cogl-internal.h
+++ b/cogl/cogl-internal.h
diff --git a/common/cogl-material-private.h b/cogl/cogl-material-private.h
index 83ddaa48..83ddaa48 100644
--- a/common/cogl-material-private.h
+++ b/cogl/cogl-material-private.h
diff --git a/common/cogl-material.c b/cogl/cogl-material.c
index cd55bf5a..cd55bf5a 100644
--- a/common/cogl-material.c
+++ b/cogl/cogl-material.c
diff --git a/cogl-material.h b/cogl/cogl-material.h
index 5a708ee4..5a708ee4 100644
--- a/cogl-material.h
+++ b/cogl/cogl-material.h
diff --git a/common/cogl-matrix-stack.c b/cogl/cogl-matrix-stack.c
index ceda0576..ceda0576 100644
--- a/common/cogl-matrix-stack.c
+++ b/cogl/cogl-matrix-stack.c
diff --git a/common/cogl-matrix-stack.h b/cogl/cogl-matrix-stack.h
index c2d0048f..1762eda9 100644
--- a/common/cogl-matrix-stack.h
+++ b/cogl/cogl-matrix-stack.h
@@ -27,7 +27,8 @@
#ifndef __COGL_MATRIX_STACK_H
#define __COGL_MATRIX_STACK_H
-#include <cogl/cogl-matrix.h>
+#include "cogl-matrix.h"
+#include "cogl.h" /* needed for GLenum */
typedef struct _CoglMatrixStack CoglMatrixStack;
diff --git a/common/cogl-matrix.c b/cogl/cogl-matrix.c
index 4cc63598..4cc63598 100644
--- a/common/cogl-matrix.c
+++ b/cogl/cogl-matrix.c
diff --git a/cogl-matrix.h b/cogl/cogl-matrix.h
index e2c07f5c..e2c07f5c 100644
--- a/cogl-matrix.h
+++ b/cogl/cogl-matrix.h
diff --git a/cogl-offscreen.h b/cogl/cogl-offscreen.h
index a3be41b7..a3be41b7 100644
--- a/cogl-offscreen.h
+++ b/cogl/cogl-offscreen.h
diff --git a/cogl-path.h b/cogl/cogl-path.h
index 08d8af92..08d8af92 100644
--- a/cogl-path.h
+++ b/cogl/cogl-path.h
diff --git a/common/cogl-primitives.c b/cogl/cogl-primitives.c
index 943657ec..943657ec 100644
--- a/common/cogl-primitives.c
+++ b/cogl/cogl-primitives.c
diff --git a/common/cogl-primitives.h b/cogl/cogl-primitives.h
index dd5a73c8..c2d76d62 100644
--- a/common/cogl-primitives.h
+++ b/cogl/cogl-primitives.h
@@ -37,9 +37,9 @@ struct _floatVec2
struct _CoglPathNode
{
- GLfloat x;
- GLfloat y;
- guint path_size;
+ float x;
+ float y;
+ guint path_size;
};
struct _CoglBezQuad
diff --git a/cogl-shader.h b/cogl/cogl-shader.h
index 9eec9bb4..9eec9bb4 100644
--- a/cogl-shader.h
+++ b/cogl/cogl-shader.h
diff --git a/common/cogl-texture-driver.h b/cogl/cogl-texture-driver.h
index f2443d0b..f2443d0b 100644
--- a/common/cogl-texture-driver.h
+++ b/cogl/cogl-texture-driver.h
diff --git a/common/cogl-texture-private.h b/cogl/cogl-texture-private.h
index bc610b67..bc610b67 100644
--- a/common/cogl-texture-private.h
+++ b/cogl/cogl-texture-private.h
diff --git a/common/cogl-texture.c b/cogl/cogl-texture.c
index 440cf456..440cf456 100644
--- a/common/cogl-texture.c
+++ b/cogl/cogl-texture.c
diff --git a/cogl-texture.h b/cogl/cogl-texture.h
index 06e85935..06e85935 100644
--- a/cogl-texture.h
+++ b/cogl/cogl-texture.h
diff --git a/cogl-types.h b/cogl/cogl-types.h
index 30c73d4f..30c73d4f 100644
--- a/cogl-types.h
+++ b/cogl/cogl-types.h
diff --git a/common/cogl-util.c b/cogl/cogl-util.c
index 2d86f73f..2d86f73f 100644
--- a/common/cogl-util.c
+++ b/cogl/cogl-util.c
diff --git a/common/cogl-util.h b/cogl/cogl-util.h
index 589ddd35..589ddd35 100644
--- a/common/cogl-util.h
+++ b/cogl/cogl-util.h
diff --git a/common/cogl-vertex-buffer-private.h b/cogl/cogl-vertex-buffer-private.h
index 55876530..55876530 100644
--- a/common/cogl-vertex-buffer-private.h
+++ b/cogl/cogl-vertex-buffer-private.h
diff --git a/common/cogl-vertex-buffer.c b/cogl/cogl-vertex-buffer.c
index a69798b1..a69798b1 100644
--- a/common/cogl-vertex-buffer.c
+++ b/cogl/cogl-vertex-buffer.c
diff --git a/cogl-vertex-buffer.h b/cogl/cogl-vertex-buffer.h
index 5f7f8708..5f7f8708 100644
--- a/cogl-vertex-buffer.h
+++ b/cogl/cogl-vertex-buffer.h
diff --git a/common/cogl.c b/cogl/cogl.c
index 85e93703..e16637e3 100644
--- a/common/cogl.c
+++ b/cogl/cogl.c
@@ -30,19 +30,14 @@
#include <string.h>
#include <math.h>
#include <stdlib.h>
-
-#ifdef HAVE_CLUTTER_GLX
-#include <dlfcn.h>
-#include <GL/glx.h>
-
-typedef CoglFuncPtr (*GLXGetProcAddressProc) (const guint8 *procName);
-#endif
+#include <gmodule.h>
#include "cogl-debug.h"
#include "cogl-internal.h"
#include "cogl-util.h"
#include "cogl-context.h"
#include "cogl-material-private.h"
+#include "cogl-winsys.h"
#if defined (HAVE_COGL_GLES2) || defined (HAVE_COGL_GLES)
#include "cogl-gles2-wrapper.h"
@@ -88,6 +83,32 @@ cogl_gl_error_to_string (GLenum error_code)
}
#endif /* COGL_GL_DEBUG */
+CoglFuncPtr
+cogl_get_proc_address (const gchar* name)
+{
+ void *address;
+ static GModule *module = NULL;
+
+ address = _cogl_winsys_get_proc_address (name);
+ if (address)
+ return address;
+
+ /* this should find the right function if the program is linked against a
+ * library providing it */
+ if (module == NULL)
+ module = g_module_open (NULL, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
+
+ if (module)
+ {
+ gpointer symbol;
+
+ if (g_module_symbol (module, name, &symbol))
+ return symbol;
+ }
+
+ return NULL;
+}
+
void
cogl_clear (const CoglColor *color, gulong buffers)
{
diff --git a/cogl.h.in b/cogl/cogl.h.in
index 9d387691..524aec71 100644
--- a/cogl.h.in
+++ b/cogl/cogl.h.in
@@ -29,7 +29,7 @@
#define __COGL_H_INSIDE__
-#include <cogl/cogl-defines-@CLUTTER_COGL@.h>
+#include <cogl/cogl-defines-@COGL_DRIVER@.h>
#include <cogl/cogl-vertex-buffer.h>
#include <cogl/cogl-matrix.h>
diff --git a/cogl/cogl.pc.in b/cogl/cogl.pc.in
new file mode 100644
index 00000000..7975f4f3
--- /dev/null
+++ b/cogl/cogl.pc.in
@@ -0,0 +1,17 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+apiversion=@CLUTTER_API_VERSION@
+requires=@CLUTTER_REQUIRES@
+backend=@COGL_WINSYS@ #only kept for backward compatability
+winsys=@COGL_WINSYS@
+cogl=@COGL_DRIVER@ #only kept for backward compatability
+driver=@COGL_DRIVER@
+
+Name: COGL
+Description: Clutter GL abstraction library (${winsys}/${driver} backend)
+Version: @VERSION@
+Libs: -L${libdir} -lclutter-${winsys}-${apiversion}
+Cflags: -I${includedir}/clutter-${apiversion}
+Requires: ${requires}
diff --git a/cogl/driver/Makefile.am b/cogl/driver/Makefile.am
new file mode 100644
index 00000000..e39b278e
--- /dev/null
+++ b/cogl/driver/Makefile.am
@@ -0,0 +1,7 @@
+include $(top_srcdir)/build/autotools/Makefile.am.silent
+
+NULL =
+
+SUBDIRS = $(COGL_DRIVER)
+
+DIST_SUBDIRS = gl gles
diff --git a/cogl/driver/gl/Makefile.am b/cogl/driver/gl/Makefile.am
new file mode 100644
index 00000000..81a21c90
--- /dev/null
+++ b/cogl/driver/gl/Makefile.am
@@ -0,0 +1,39 @@
+include $(top_srcdir)/build/autotools/Makefile.am.silent
+
+NULL =
+
+INCLUDES = \
+ -I$(top_srcdir) \
+ -I$(srcdir) \
+ -I$(srcdir)/../.. \
+ -I$(srcdir)/../../.. \
+ -I$(srcdir)/winsys \
+ -I$(srcdir)/driver/$(COGL_DRIVER) \
+ -I../.. \
+ -I../../.. \
+ -DG_DISABLE_SINGLE_INCLUDES \
+ -DG_LOG_DOMAIN=\"Cogl-Driver\" \
+ -DCLUTTER_COMPILATION
+
+noinst_LTLIBRARIES = libclutter-cogl-driver.la
+libclutter_cogl_driver_la_CPPFLAGS = \
+ $(CLUTTER_CFLAGS) \
+ $(COGL_DEBUG_CFLAGS) \
+ $(CLUTTER_DEBUG_CFLAGS) \
+ $(MAINTAINER_CFLAGS)
+libclutter_cogl_driver_la_SOURCES = \
+ cogl.c \
+ cogl-primitives.c \
+ cogl-texture-driver.c \
+ cogl-fbo.h \
+ cogl-fbo.c \
+ cogl-shader-private.h \
+ cogl-shader.c \
+ cogl-program.h \
+ cogl-program.c \
+ cogl-context-driver.h \
+ cogl-context-driver.c \
+ $(NULL)
+
+EXTRA_DIST = cogl-defines.h.in
+
diff --git a/gl/cogl-context-driver.c b/cogl/driver/gl/cogl-context-driver.c
index dcf65ef2..dcf65ef2 100644
--- a/gl/cogl-context-driver.c
+++ b/cogl/driver/gl/cogl-context-driver.c
diff --git a/gl/cogl-context-driver.h b/cogl/driver/gl/cogl-context-driver.h
index ac5e6162..ac5e6162 100644
--- a/gl/cogl-context-driver.h
+++ b/cogl/driver/gl/cogl-context-driver.h
diff --git a/gl/cogl-defines.h.in b/cogl/driver/gl/cogl-defines.h.in
index 1c79bedf..1c79bedf 100644
--- a/gl/cogl-defines.h.in
+++ b/cogl/driver/gl/cogl-defines.h.in
diff --git a/gl/cogl-fbo.c b/cogl/driver/gl/cogl-fbo.c
index d77304e6..d77304e6 100644
--- a/gl/cogl-fbo.c
+++ b/cogl/driver/gl/cogl-fbo.c
diff --git a/gl/cogl-fbo.h b/cogl/driver/gl/cogl-fbo.h
index 8499f8fb..8499f8fb 100644
--- a/gl/cogl-fbo.h
+++ b/cogl/driver/gl/cogl-fbo.h
diff --git a/gl/cogl-primitives.c b/cogl/driver/gl/cogl-primitives.c
index 934fe137..934fe137 100644
--- a/gl/cogl-primitives.c
+++ b/cogl/driver/gl/cogl-primitives.c
diff --git a/gl/cogl-program.c b/cogl/driver/gl/cogl-program.c
index 032b96e4..032b96e4 100644
--- a/gl/cogl-program.c
+++ b/cogl/driver/gl/cogl-program.c
diff --git a/gl/cogl-program.h b/cogl/driver/gl/cogl-program.h
index 3a6bdf5b..3a6bdf5b 100644
--- a/gl/cogl-program.h
+++ b/cogl/driver/gl/cogl-program.h
diff --git a/gl/cogl-shader-private.h b/cogl/driver/gl/cogl-shader-private.h
index f698c6c6..f698c6c6 100644
--- a/gl/cogl-shader-private.h
+++ b/cogl/driver/gl/cogl-shader-private.h
diff --git a/gl/cogl-shader.c b/cogl/driver/gl/cogl-shader.c
index 5358c514..5358c514 100644
--- a/gl/cogl-shader.c
+++ b/cogl/driver/gl/cogl-shader.c
diff --git a/gl/cogl-texture-driver.c b/cogl/driver/gl/cogl-texture-driver.c
index b5a0f428..b5a0f428 100644
--- a/gl/cogl-texture-driver.c
+++ b/cogl/driver/gl/cogl-texture-driver.c
diff --git a/gl/cogl.c b/cogl/driver/gl/cogl.c
index 84198154..04d3b750 100644
--- a/gl/cogl.c
+++ b/cogl/driver/gl/cogl.c
@@ -26,84 +26,12 @@
#endif
#include <string.h>
-#include <gmodule.h>
#include "cogl.h"
-#ifdef HAVE_CLUTTER_GLX
-#include <dlfcn.h>
-#include <GL/glx.h>
-
-typedef CoglFuncPtr (*GLXGetProcAddressProc) (const guint8 *procName);
-#endif
-
#include "cogl-internal.h"
#include "cogl-context.h"
-CoglFuncPtr
-cogl_get_proc_address (const gchar* name)
-{
- /* Sucks to ifdef here but not other option..? would be nice to
- * split the code up for more reuse (once more backends use this
- */
-#if defined(HAVE_CLUTTER_GLX)
- static GLXGetProcAddressProc get_proc_func = NULL;
- static void *dlhand = NULL;
-
- if (get_proc_func == NULL && dlhand == NULL)
- {
- dlhand = dlopen (NULL, RTLD_LAZY);
-
- if (dlhand)
- {
- dlerror ();
-
- get_proc_func =
- (GLXGetProcAddressProc) dlsym (dlhand, "glXGetProcAddress");
-
- if (dlerror () != NULL)
- {
- get_proc_func =
- (GLXGetProcAddressProc) dlsym (dlhand, "glXGetProcAddressARB");
- }
-
- if (dlerror () != NULL)
- {
- get_proc_func = NULL;
- g_warning ("failed to bind GLXGetProcAddress "
- "or GLXGetProcAddressARB");
- }
- }
- }
-
- if (get_proc_func)
- return get_proc_func ((unsigned char*) name);
-
-#elif defined(HAVE_CLUTTER_WIN32)
-
- return (CoglFuncPtr) wglGetProcAddress ((LPCSTR) name);
-
-#else /* HAVE_CLUTTER_WIN32 */
-
- /* this should find the right function if the program is linked against a
- * library providing it */
- static GModule *module = NULL;
- if (module == NULL)
- module = g_module_open (NULL, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
-
- if (module)
- {
- gpointer symbol;
-
- if (g_module_symbol (module, name, &symbol))
- return symbol;
- }
-
-#endif /* HAVE_CLUTTER_WIN32 */
-
- return NULL;
-}
-
gboolean
cogl_check_extension (const gchar *name, const gchar *ext)
{
diff --git a/cogl/driver/gles/Makefile.am b/cogl/driver/gles/Makefile.am
new file mode 100644
index 00000000..df126c04
--- /dev/null
+++ b/cogl/driver/gles/Makefile.am
@@ -0,0 +1,62 @@
+include $(top_srcdir)/build/autotools/Makefile.am.silent
+
+NULL =
+
+INCLUDES = \
+ -I$(top_srcdir) \
+ -I$(srcdir) \
+ -I$(srcdir)/../.. \
+ -I$(srcdir)/../../.. \
+ -I$(srcdir)/winsys \
+ -I$(srcdir)/driver/$(COGL_DRIVER) \
+ -I../.. \
+ -I../../.. \
+ -DG_DISABLE_SINGLE_INCLUDES \
+ -DG_LOG_DOMAIN=\"Cogl-Driver\" \
+ -DCLUTTER_COMPILATION
+
+noinst_LTLIBRARIES = libclutter-cogl-driver.la
+libclutter_cogl_driver_la_CPPFLAGS = \
+ $(CLUTTER_CFLAGS) \
+ $(COGL_DEBUG_CFLAGS) \
+ $(CLUTTER_DEBUG_CFLAGS) \
+ $(MAINTAINER_CFLAGS)
+libclutter_cogl_driver_la_SOURCES = \
+ cogl-fbo.h \
+ cogl.c \
+ cogl-primitives.c \
+ cogl-texture-driver.c \
+ cogl-fbo.c \
+ cogl-context-driver.c \
+ cogl-gles2-wrapper.h \
+ cogl-program.h \
+ cogl-program.c \
+ cogl-shader-private.h \
+ cogl-shader.c
+
+if USE_GLES2_WRAPPER
+libclutter_cogl_driver_la_SOURCES += \
+ cogl-gles2-wrapper.c \
+ cogl-fixed-vertex-shader.h \
+ cogl-fixed-vertex-shader.c \
+ cogl-fixed-fragment-shader.h \
+ cogl-fixed-fragment-shader.c
+endif
+
+EXTRA_DIST = \
+ cogl-defines.h.in \
+ stringify.sh \
+ cogl-fixed-vertex-shader.glsl \
+ cogl-fixed-fragment-shader.glsl
+
+BUILT_SOURCES = \
+ cogl-fixed-vertex-shader.h \
+ cogl-fixed-vertex-shader.c \
+ cogl-fixed-fragment-shader.h \
+ cogl-fixed-fragment-shader.c
+
+%.h: $(srcdir)/%.glsl
+ /bin/sh $(srcdir)/stringify.sh -h $< > $@
+%.c: $(srcdir)/%.glsl
+ /bin/sh $(srcdir)/stringify.sh $< > $@
+
diff --git a/gles/cogl-context-driver.c b/cogl/driver/gles/cogl-context-driver.c
index ee38b9b9..ee38b9b9 100644
--- a/gles/cogl-context-driver.c
+++ b/cogl/driver/gles/cogl-context-driver.c
diff --git a/gles/cogl-context-driver.h b/cogl/driver/gles/cogl-context-driver.h
index 06f0ee00..06f0ee00 100644
--- a/gles/cogl-context-driver.h
+++ b/cogl/driver/gles/cogl-context-driver.h
diff --git a/gles/cogl-defines.h.in b/cogl/driver/gles/cogl-defines.h.in
index 97045df9..97045df9 100644
--- a/gles/cogl-defines.h.in
+++ b/cogl/driver/gles/cogl-defines.h.in
diff --git a/gles/cogl-fbo.c b/cogl/driver/gles/cogl-fbo.c
index a1b41971..a1b41971 100644
--- a/gles/cogl-fbo.c
+++ b/cogl/driver/gles/cogl-fbo.c
diff --git a/gles/cogl-fbo.h b/cogl/driver/gles/cogl-fbo.h
index 8499f8fb..8499f8fb 100644
--- a/gles/cogl-fbo.h
+++ b/cogl/driver/gles/cogl-fbo.h
diff --git a/gles/cogl-fixed-fragment-shader.glsl b/cogl/driver/gles/cogl-fixed-fragment-shader.glsl
index 128afb42..128afb42 100644
--- a/gles/cogl-fixed-fragment-shader.glsl
+++ b/cogl/driver/gles/cogl-fixed-fragment-shader.glsl
diff --git a/gles/cogl-fixed-vertex-shader.glsl b/cogl/driver/gles/cogl-fixed-vertex-shader.glsl
index e5d30a64..e5d30a64 100644
--- a/gles/cogl-fixed-vertex-shader.glsl
+++ b/cogl/driver/gles/cogl-fixed-vertex-shader.glsl
diff --git a/gles/cogl-gles2-wrapper.c b/cogl/driver/gles/cogl-gles2-wrapper.c
index b8aa92cd..b8aa92cd 100644
--- a/gles/cogl-gles2-wrapper.c
+++ b/cogl/driver/gles/cogl-gles2-wrapper.c
diff --git a/gles/cogl-gles2-wrapper.h b/cogl/driver/gles/cogl-gles2-wrapper.h
index e8154603..e8154603 100644
--- a/gles/cogl-gles2-wrapper.h
+++ b/cogl/driver/gles/cogl-gles2-wrapper.h
diff --git a/gles/cogl-primitives.c b/cogl/driver/gles/cogl-primitives.c
index 65705a4c..65705a4c 100644
--- a/gles/cogl-primitives.c
+++ b/cogl/driver/gles/cogl-primitives.c
diff --git a/gles/cogl-program.c b/cogl/driver/gles/cogl-program.c
index 088cecfe..088cecfe 100644
--- a/gles/cogl-program.c
+++ b/cogl/driver/gles/cogl-program.c
diff --git a/gles/cogl-program.h b/cogl/driver/gles/cogl-program.h
index 23b7ebeb..23b7ebeb 100644
--- a/gles/cogl-program.h
+++ b/cogl/driver/gles/cogl-program.h
diff --git a/gles/cogl-shader-private.h b/cogl/driver/gles/cogl-shader-private.h
index 2b905d89..2b905d89 100644
--- a/gles/cogl-shader-private.h
+++ b/cogl/driver/gles/cogl-shader-private.h
diff --git a/gles/cogl-shader.c b/cogl/driver/gles/cogl-shader.c
index 23109be3..23109be3 100644
--- a/gles/cogl-shader.c
+++ b/cogl/driver/gles/cogl-shader.c
diff --git a/gles/cogl-texture-driver.c b/cogl/driver/gles/cogl-texture-driver.c
index 1d50a198..1d50a198 100644
--- a/gles/cogl-texture-driver.c
+++ b/cogl/driver/gles/cogl-texture-driver.c
diff --git a/gles/cogl-util.c b/cogl/driver/gles/cogl-util.c
index 4fc90b8e..4fc90b8e 100644
--- a/gles/cogl-util.c
+++ b/cogl/driver/gles/cogl-util.c
diff --git a/gles/cogl-util.h b/cogl/driver/gles/cogl-util.h
index 589ddd35..589ddd35 100644
--- a/gles/cogl-util.h
+++ b/cogl/driver/gles/cogl-util.h
diff --git a/gles/cogl.c b/cogl/driver/gles/cogl.c
index 0fcf4fc3..aa7da6ef 100644
--- a/gles/cogl.c
+++ b/cogl/driver/gles/cogl.c
@@ -31,17 +31,7 @@
#include "cogl-internal.h"
#include "cogl-context.h"
-CoglFuncPtr
-cogl_get_proc_address (const gchar* name)
-{
- return NULL;
-}
-gboolean
-cogl_check_extension (const gchar *name, const gchar *ext)
-{
- return FALSE;
-}
void
_cogl_features_init (void)
diff --git a/gles/stringify.sh b/cogl/driver/gles/stringify.sh
index 721528a8..721528a8 100644
--- a/gles/stringify.sh
+++ b/cogl/driver/gles/stringify.sh
diff --git a/common/stb_image.c b/cogl/stb_image.c
index bd3e63b3..bd3e63b3 100644
--- a/common/stb_image.c
+++ b/cogl/stb_image.c
diff --git a/cogl/winsys/Makefile.am b/cogl/winsys/Makefile.am
new file mode 100644
index 00000000..684da4ae
--- /dev/null
+++ b/cogl/winsys/Makefile.am
@@ -0,0 +1,43 @@
+include $(top_srcdir)/build/autotools/Makefile.am.silent
+
+NULL =
+
+INCLUDES = \
+ -I$(top_srcdir) \
+ -I$(srcdir) \
+ -I$(srcdir)/.. \
+ -I$(srcdir)/../driver/$(COGL_DRIVER) \
+ -I$(srcdir)/../.. \
+ -I.. \
+ -I../.. \
+ -DG_DISABLE_SINGLE_INCLUDES \
+ -DG_LOG_DOMAIN=\"Cogl-Winsys\" \
+ -DCLUTTER_COMPILATION
+
+noinst_LTLIBRARIES = libclutter-cogl-winsys.la
+
+# Automake can't determine the full list if we are using autoconf substitutions
+# to specify the files required for libclutter-cogl-winsys
+all_winsys_sources = \
+ cogl-glx.c \
+ cogl-eglx.c \
+ cogl-eglnative.c \
+ cogl-sdl.c \
+ cogl-win32.c \
+ cogl-osx.c \
+ cogl-winsys.h
+ $(NULL)
+
+libclutter_cogl_winsys_la_CPPFLAGS = \
+ $(CLUTTER_CFLAGS) \
+ $(COGL_DEBUG_CFLAGS) \
+ $(CLUTTER_DEBUG_CFLAGS) \
+ $(MAINTAINER_CFLAGS)
+libclutter_cogl_winsys_la_LIBADD = -lm $(CLUTTER_LIBS)
+libclutter_cogl_winsys_la_SOURCES = \
+ cogl-@COGL_WINSYS@.h \
+ cogl-@COGL_WINSYS@.c \
+ $(NULL)
+
+EXTRA_DIST=$(all_winsys_sources)
+
diff --git a/cogl/winsys/cogl-eglnative.c b/cogl/winsys/cogl-eglnative.c
new file mode 100644
index 00000000..3bf5b0fb
--- /dev/null
+++ b/cogl/winsys/cogl-eglnative.c
@@ -0,0 +1,35 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2007,2008,2009 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, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl.h"
+
+CoglFuncPtr
+_cogl_winsys_get_proc_address (const char *name)
+{
+ return NULL;
+}
+
diff --git a/cogl/winsys/cogl-eglx.c b/cogl/winsys/cogl-eglx.c
new file mode 100644
index 00000000..3bf5b0fb
--- /dev/null
+++ b/cogl/winsys/cogl-eglx.c
@@ -0,0 +1,35 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2007,2008,2009 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, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl.h"
+
+CoglFuncPtr
+_cogl_winsys_get_proc_address (const char *name)
+{
+ return NULL;
+}
+
diff --git a/cogl/winsys/cogl-fruity.c b/cogl/winsys/cogl-fruity.c
new file mode 100644
index 00000000..3bf5b0fb
--- /dev/null
+++ b/cogl/winsys/cogl-fruity.c
@@ -0,0 +1,35 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2007,2008,2009 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, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl.h"
+
+CoglFuncPtr
+_cogl_winsys_get_proc_address (const char *name)
+{
+ return NULL;
+}
+
diff --git a/cogl/winsys/cogl-glx.c b/cogl/winsys/cogl-glx.c
new file mode 100644
index 00000000..fb513122
--- /dev/null
+++ b/cogl/winsys/cogl-glx.c
@@ -0,0 +1,78 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2007,2008,2009 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, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl.h"
+
+#ifdef HAVE_CLUTTER_GLX
+#include <dlfcn.h>
+#include <GL/glx.h>
+
+typedef CoglFuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName);
+#endif
+
+
+CoglFuncPtr
+_cogl_winsys_get_proc_address (const char *name)
+{
+ static GLXGetProcAddressProc get_proc_func = NULL;
+ static void *dlhand = NULL;
+
+ if (get_proc_func == NULL && dlhand == NULL)
+ {
+ dlhand = dlopen (NULL, RTLD_LAZY);
+
+ if (!dlhand)
+ {
+ g_warning ("Failed to dlopen (NULL, RTDL_LAZY): %s", dlerror ());
+ return NULL;
+ }
+
+ dlerror ();
+
+ get_proc_func =
+ (GLXGetProcAddressProc) dlsym (dlhand, "glXGetProcAddress");
+
+ if (dlerror () != NULL)
+ {
+ get_proc_func =
+ (GLXGetProcAddressProc) dlsym (dlhand, "glXGetProcAddressARB");
+ }
+
+ if (dlerror () != NULL)
+ {
+ get_proc_func = NULL;
+ g_warning ("failed to bind GLXGetProcAddress "
+ "or GLXGetProcAddressARB");
+ }
+ }
+
+ if (get_proc_func)
+ return get_proc_func ((GLubyte *) name);
+
+ return NULL;
+}
+
diff --git a/cogl/winsys/cogl-osx.c b/cogl/winsys/cogl-osx.c
new file mode 100644
index 00000000..3bf5b0fb
--- /dev/null
+++ b/cogl/winsys/cogl-osx.c
@@ -0,0 +1,35 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2007,2008,2009 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, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl.h"
+
+CoglFuncPtr
+_cogl_winsys_get_proc_address (const char *name)
+{
+ return NULL;
+}
+
diff --git a/cogl/winsys/cogl-sdl.c b/cogl/winsys/cogl-sdl.c
new file mode 100644
index 00000000..3bf5b0fb
--- /dev/null
+++ b/cogl/winsys/cogl-sdl.c
@@ -0,0 +1,35 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2007,2008,2009 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, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl.h"
+
+CoglFuncPtr
+_cogl_winsys_get_proc_address (const char *name)
+{
+ return NULL;
+}
+
diff --git a/cogl/winsys/cogl-win32.c b/cogl/winsys/cogl-win32.c
new file mode 100644
index 00000000..8c1ac9cc
--- /dev/null
+++ b/cogl/winsys/cogl-win32.c
@@ -0,0 +1,35 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2007,2008,2009 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, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cogl.h"
+
+CoglFuncPtr
+_cogl_winsys_get_proc_address (const char *name)
+{
+ return (CoglFuncPtr) wglGetProcAddress ((LPCSTR) name);
+}
+
diff --git a/cogl/winsys/cogl-winsys.h b/cogl/winsys/cogl-winsys.h
new file mode 100644
index 00000000..ab83c29a
--- /dev/null
+++ b/cogl/winsys/cogl-winsys.h
@@ -0,0 +1,30 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2007,2008,2009 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, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __COGL_WINSYS_H
+#define __COGL_WINSYS_H
+
+CoglFuncPtr
+_cogl_winsys_get_proc_address (const char *name);
+
+#endif /* __COGL_WINSYS_H */
diff --git a/common/Makefile.am b/common/Makefile.am
deleted file mode 100644
index ef1c342f..00000000
--- a/common/Makefile.am
+++ /dev/null
@@ -1,96 +0,0 @@
-include $(top_srcdir)/build/autotools/Makefile.am.silent
-
-NULL =
-
-INCLUDES = \
- -I$(top_srcdir) \
- -I$(top_srcdir)/clutter \
- -I$(top_srcdir)/clutter/cogl \
- -I$(top_srcdir)/clutter/cogl/common \
- -I$(top_srcdir)/clutter/cogl/$(CLUTTER_COGL) \
- -I$(top_builddir)/clutter \
- -I$(top_builddir)/clutter/cogl \
- -DG_DISABLE_SINGLE_INCLUDES \
- -DG_LOG_DOMAIN=\"Cogl-Common\" \
- -DCLUTTER_COMPILATION
-
-cogl_public_h = \
- $(top_srcdir)/clutter/cogl/cogl-bitmap.h \
- $(top_srcdir)/clutter/cogl/cogl-color.h \
- $(top_srcdir)/clutter/cogl/cogl-debug.h \
- $(top_srcdir)/clutter/cogl/cogl-fixed.h \
- $(top_srcdir)/clutter/cogl/cogl-material.h \
- $(top_srcdir)/clutter/cogl/cogl-matrix.h \
- $(top_srcdir)/clutter/cogl/cogl-offscreen.h \
- $(top_srcdir)/clutter/cogl/cogl-path.h \
- $(top_srcdir)/clutter/cogl/cogl-shader.h \
- $(top_srcdir)/clutter/cogl/cogl-texture.h \
- $(top_srcdir)/clutter/cogl/cogl-types.h \
- $(top_srcdir)/clutter/cogl/cogl-vertex-buffer.h \
- $(top_builddir)/clutter/cogl/cogl.h \
- $(NULL)
-
-noinst_LTLIBRARIES = libclutter-cogl-common.la
-
-cogl-enum-types.h: stamp-cogl-enum-types.h
- @true
-stamp-cogl-enum-types.h: $(cogl_public_h) Makefile
- $(QUIET_GEN)( $(GLIB_MKENUMS) \
- --template $(srcdir)/cogl-enum-types.h.in \
- $(cogl_public_h) ) > xgen-ceth \
- && (cmp -s xgen-ceth cogl-enum-types.h || cp -f xgen-ceth cogl-enum-types.h) \
- && cp -f cogl-enum-types.h $(top_builddir)/clutter/cogl/cogl-enum-types.h \
- && rm -f xgen-ceth \
- && echo timestamp > $(@F)
-
-cogl-enum-types.c: cogl-enum-types.h
- $(QUIET_GEN)( $(GLIB_MKENUMS) \
- --template $(srcdir)/cogl-enum-types.c.in \
- $(cogl_public_h) ) > xgen-cetc \
- && cp -f xgen-cetc cogl-enum-types.c \
- && rm -f xgen-cetc
-
-BUILT_SOURCES = cogl-enum-types.h cogl-enum-types.c
-
-libclutter_cogl_common_la_CPPFLAGS = $(CLUTTER_CFLAGS) $(COGL_DEBUG_CFLAGS) $(CLUTTER_DEBUG_CFLAGS) $(MAINTAINER_CFLAGS)
-libclutter_cogl_common_la_LIBADD = -lm $(CLUTTER_LIBS)
-libclutter_cogl_common_la_SOURCES = \
- $(top_builddir)/clutter/cogl/common/cogl-enum-types.h \
- $(top_builddir)/clutter/cogl/common/cogl-enum-types.c \
- cogl-handle.h \
- cogl-context.h \
- cogl-context.c \
- cogl-internal.h \
- cogl.c \
- cogl-util.h \
- cogl-util.c \
- cogl-bitmap-private.h \
- cogl-bitmap.c \
- cogl-bitmap-fallback.c \
- cogl-current-matrix.c \
- cogl-current-matrix.h \
- cogl-primitives.h \
- cogl-primitives.c \
- cogl-bitmap-pixbuf.c \
- cogl-clip-stack.h \
- cogl-clip-stack.c \
- cogl-fixed.c \
- cogl-color.c \
- cogl-vertex-buffer-private.h \
- cogl-vertex-buffer.c \
- cogl-matrix.c \
- cogl-matrix-stack.c \
- cogl-matrix-stack.h \
- cogl-material.c \
- cogl-material-private.h \
- cogl-blend-string.c \
- cogl-blend-string.h \
- cogl-debug.c \
- cogl-texture-private.h \
- cogl-texture-driver.h \
- cogl-texture.c \
- $(NULL)
-
-EXTRA_DIST = stb_image.c cogl-enum-types.h.in cogl-enum-types.c.in
-CLEANFILES = stamp-cogl-enum-types.h
-DISTCLEANFILES = cogl-enum-types.h cogl-enum-types.c
diff --git a/doc/reference/cogl/Makefile.am b/doc/reference/cogl/Makefile.am
index e031b341..89389e3d 100644
--- a/doc/reference/cogl/Makefile.am
+++ b/doc/reference/cogl/Makefile.am
@@ -18,7 +18,7 @@ DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
# gtk-doc will search all .c & .h files beneath here for inline comments
# documenting the functions and macros.
# e.g. DOC_SOURCE_DIR=../../../gtk
-DOC_SOURCE_DIR=../../../clutter/cogl
+DOC_SOURCE_DIR=../../../clutter/cogl/cogl
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
SCANGOBJ_OPTIONS=--type-init-func="g_type_init()"
@@ -46,10 +46,9 @@ FIXXREF_OPTIONS=\
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
HFILE_GLOB=\
- $(top_srcdir)/clutter/cogl/*.h \
- $(top_srcdir)/clutter/cogl/common/*.h
+ $(top_srcdir)/clutter/cogl/cogl/*.h
CFILE_GLOB=\
- $(top_srcdir)/clutter/cogl/common/*.c
+ $(top_srcdir)/clutter/cogl/cogl/*.c
# Header files to ignore when scanning.
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
@@ -90,8 +89,8 @@ expand_content_files = \
# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
-INCLUDES=-I$(top_srcdir) -I$(top_srcdir)/clutter $(CLUTTER_CFLAGS)
-GTKDOC_LIBS=$(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
+INCLUDES=-I$(top_srcdir) -I$(top_srcdir)/clutter -I$(top_srcdir)/clutter/cogl $(CLUTTER_CFLAGS)
+GTKDOC_LIBS=$(top_builddir)/clutter/libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make