From 43efab46bcf88c14cc429c6c7b659bdbc84f1f71 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Tue, 28 Jul 2009 02:02:02 +0100 Subject: [PATCH] Intial Re-layout of the Cogl source code and introduction of a Cogl Winsys As part of an incremental process to have Cogl be a standalone project we want to re-consider how we organise the Cogl source code. Currently this is the structure I'm aiming for: cogl/ cogl/ winsys/ cogl-glx.c cogl-wgl.c driver/ gl/ gles/ os/ ? utils/ cogl-fixed cogl-matrix-stack? cogl-journal? cogl-primitives? pango/ The new winsys component is a starting point for migrating window system code (i.e. x11,glx,wgl,osx,egl etc) from Clutter to Cogl. The utils/ and pango/ directories aren't added by this commit, but they are noted because I plan to add them soon. Overview of the planned structure: * The winsys/ API is the API that binds OpenGL to a specific window system, be that X11 or win32 etc. Example are glx, wgl and egl. Much of the logic under clutter/{glx,osx,win32 etc} should migrate here. * Note there is also the idea of a winsys-base that may represent a window system for which there are multiple winsys APIs. An example of this is x11, since glx and egl may both be used with x11. (currently only Clutter has the idea of a winsys-base) * The driver/ represents a specific varient of OpenGL. Currently we have "gl" representing OpenGL 1.4-2.1 (mostly fixed function) and "gles" representing GLES 1.1 (fixed funciton) and 2.0 (fully shader based) * Everything under cogl/ should fundamentally be supporting access to the GPU. Essentially Cogl's most basic requirement is to provide a nice GPU Graphics API and drawing a line between this and the utility functionality we add to support Clutter should help keep this lean and maintainable. * Code under utils/ as suggested builds on cogl/ adding more convenient APIs or mechanism to optimize special cases. Broadly speaking you can compare cogl/ to OpenGL and utils/ to GLU. * clutter/pango will be moved to clutter/cogl/pango How some of the internal configure.ac/pkg-config terminology has changed: backendextra -> CLUTTER_WINSYS_BASE # e.g. "x11" backendextralib -> CLUTTER_WINSYS_BASE_LIB # e.g. "x11/libclutter-x11.la" clutterbackend -> {CLUTTER,COGL}_WINSYS # e.g. "glx" CLUTTER_FLAVOUR -> {CLUTTER,COGL}_WINSYS clutterbackendlib -> CLUTTER_WINSYS_LIB CLUTTER_COGL -> COGL_DRIVER # e.g. "gl" Note: The CLUTTER_FLAVOUR and CLUTTER_COGL defines are kept for apps As the first thing to take advantage of the new winsys component in Cogl; cogl_get_proc_address() has been moved from cogl/{gl,gles}/cogl.c into cogl/common/cogl.c and this common implementation first trys _cogl_winsys_get_proc_address() but if that fails then it falls back to gmodule. --- Makefile.am | 8 +- clutter.pc.in | 10 +- clutter/Makefile.am | 38 ++--- clutter/cogl/Makefile.am | 89 +--------- clutter/cogl/TODO | 25 --- clutter/cogl/cogl.pc.in | 15 -- clutter/cogl/cogl/Makefile.am | 161 ++++++++++++++++++ .../{common => cogl}/cogl-bitmap-fallback.c | 0 .../{common => cogl}/cogl-bitmap-pixbuf.c | 0 .../{common => cogl}/cogl-bitmap-private.h | 0 clutter/cogl/{common => cogl}/cogl-bitmap.c | 0 clutter/cogl/{ => cogl}/cogl-bitmap.h | 0 .../cogl/{common => cogl}/cogl-blend-string.c | 0 .../cogl/{common => cogl}/cogl-blend-string.h | 0 .../cogl/{common => cogl}/cogl-clip-stack.c | 0 .../cogl/{common => cogl}/cogl-clip-stack.h | 0 clutter/cogl/{common => cogl}/cogl-color.c | 0 clutter/cogl/{ => cogl}/cogl-color.h | 0 clutter/cogl/{common => cogl}/cogl-context.c | 0 clutter/cogl/{common => cogl}/cogl-context.h | 0 .../{common => cogl}/cogl-current-matrix.c | 0 .../{common => cogl}/cogl-current-matrix.h | 0 clutter/cogl/{common => cogl}/cogl-debug.c | 0 clutter/cogl/{ => cogl}/cogl-debug.h | 0 clutter/cogl/{ => cogl}/cogl-deprecated.h | 0 .../{common => cogl}/cogl-enum-types.c.in | 0 .../{common => cogl}/cogl-enum-types.h.in | 0 clutter/cogl/{common => cogl}/cogl-fixed.c | 0 clutter/cogl/{ => cogl}/cogl-fixed.h | 0 clutter/cogl/{common => cogl}/cogl-handle.h | 0 clutter/cogl/{common => cogl}/cogl-internal.h | 0 .../{common => cogl}/cogl-material-private.h | 0 clutter/cogl/{common => cogl}/cogl-material.c | 0 clutter/cogl/{ => cogl}/cogl-material.h | 0 .../cogl/{common => cogl}/cogl-matrix-stack.c | 0 .../cogl/{common => cogl}/cogl-matrix-stack.h | 3 +- clutter/cogl/{common => cogl}/cogl-matrix.c | 0 clutter/cogl/{ => cogl}/cogl-matrix.h | 0 clutter/cogl/{ => cogl}/cogl-offscreen.h | 0 clutter/cogl/{ => cogl}/cogl-path.h | 0 .../cogl/{common => cogl}/cogl-primitives.c | 0 .../cogl/{common => cogl}/cogl-primitives.h | 6 +- clutter/cogl/{ => cogl}/cogl-shader.h | 0 .../{common => cogl}/cogl-texture-driver.h | 0 .../{common => cogl}/cogl-texture-private.h | 0 clutter/cogl/{common => cogl}/cogl-texture.c | 0 clutter/cogl/{ => cogl}/cogl-texture.h | 0 clutter/cogl/{ => cogl}/cogl-types.h | 0 clutter/cogl/{common => cogl}/cogl-util.c | 0 clutter/cogl/{common => cogl}/cogl-util.h | 0 .../cogl-vertex-buffer-private.h | 0 .../{common => cogl}/cogl-vertex-buffer.c | 0 clutter/cogl/{ => cogl}/cogl-vertex-buffer.h | 0 clutter/cogl/{common => cogl}/cogl.c | 35 +++- clutter/cogl/{ => cogl}/cogl.h.in | 2 +- clutter/cogl/cogl/cogl.pc.in | 17 ++ clutter/cogl/cogl/driver/Makefile.am | 7 + clutter/cogl/cogl/driver/gl/Makefile.am | 39 +++++ .../driver}/gl/cogl-context-driver.c | 0 .../driver}/gl/cogl-context-driver.h | 0 .../{ => cogl/driver}/gl/cogl-defines.h.in | 0 clutter/cogl/{ => cogl/driver}/gl/cogl-fbo.c | 0 clutter/cogl/{ => cogl/driver}/gl/cogl-fbo.h | 0 .../{ => cogl/driver}/gl/cogl-primitives.c | 0 .../cogl/{ => cogl/driver}/gl/cogl-program.c | 0 .../cogl/{ => cogl/driver}/gl/cogl-program.h | 0 .../driver}/gl/cogl-shader-private.h | 0 .../cogl/{ => cogl/driver}/gl/cogl-shader.c | 0 .../driver}/gl/cogl-texture-driver.c | 0 clutter/cogl/{ => cogl/driver}/gl/cogl.c | 72 -------- clutter/cogl/cogl/driver/gles/Makefile.am | 62 +++++++ .../driver}/gles/cogl-context-driver.c | 0 .../driver}/gles/cogl-context-driver.h | 0 .../{ => cogl/driver}/gles/cogl-defines.h.in | 0 .../cogl/{ => cogl/driver}/gles/cogl-fbo.c | 0 .../cogl/{ => cogl/driver}/gles/cogl-fbo.h | 0 .../gles/cogl-fixed-fragment-shader.glsl | 0 .../gles/cogl-fixed-vertex-shader.glsl | 0 .../driver}/gles/cogl-gles2-wrapper.c | 0 .../driver}/gles/cogl-gles2-wrapper.h | 0 .../{ => cogl/driver}/gles/cogl-primitives.c | 0 .../{ => cogl/driver}/gles/cogl-program.c | 0 .../{ => cogl/driver}/gles/cogl-program.h | 0 .../driver}/gles/cogl-shader-private.h | 0 .../cogl/{ => cogl/driver}/gles/cogl-shader.c | 0 .../driver}/gles/cogl-texture-driver.c | 0 .../cogl/{ => cogl/driver}/gles/cogl-util.c | 0 .../cogl/{ => cogl/driver}/gles/cogl-util.h | 0 clutter/cogl/{ => cogl/driver}/gles/cogl.c | 10 -- .../cogl/{ => cogl/driver}/gles/stringify.sh | 0 clutter/cogl/{common => cogl}/stb_image.c | 0 clutter/cogl/cogl/winsys/Makefile.am | 43 +++++ clutter/cogl/cogl/winsys/cogl-eglnative.c | 35 ++++ clutter/cogl/cogl/winsys/cogl-eglx.c | 35 ++++ clutter/cogl/cogl/winsys/cogl-fruity.c | 35 ++++ clutter/cogl/cogl/winsys/cogl-glx.c | 78 +++++++++ clutter/cogl/cogl/winsys/cogl-osx.c | 35 ++++ clutter/cogl/cogl/winsys/cogl-sdl.c | 35 ++++ clutter/cogl/cogl/winsys/cogl-win32.c | 35 ++++ clutter/cogl/cogl/winsys/cogl-winsys.h | 30 ++++ clutter/cogl/common/Makefile.am | 96 ----------- clutter/eglnative/Makefile.am | 12 +- clutter/eglx/Makefile.am | 2 + clutter/fruity/Makefile.am | 8 +- clutter/glx/Makefile.am | 2 + clutter/osx/Makefile.am | 6 +- clutter/sdl/Makefile.am | 2 + clutter/win32/Makefile.am | 2 + clutter/win32/clutter-win32.pc.in | 8 +- clutter/x11/Makefile.am | 2 + clutter/x11/clutter-x11.pc.in | 10 +- configure.ac | 119 +++++++------ doc/reference/clutter/Makefile.am | 6 +- doc/reference/cogl/Makefile.am | 11 +- tests/conform/Makefile.am | 4 +- tests/interactive/Makefile.am | 4 +- tests/micro-bench/Makefile.am | 9 +- tests/tools/Makefile.am | 2 + 118 files changed, 834 insertions(+), 431 deletions(-) delete mode 100644 clutter/cogl/TODO delete mode 100644 clutter/cogl/cogl.pc.in create mode 100644 clutter/cogl/cogl/Makefile.am rename clutter/cogl/{common => cogl}/cogl-bitmap-fallback.c (100%) rename clutter/cogl/{common => cogl}/cogl-bitmap-pixbuf.c (100%) rename clutter/cogl/{common => cogl}/cogl-bitmap-private.h (100%) rename clutter/cogl/{common => cogl}/cogl-bitmap.c (100%) rename clutter/cogl/{ => cogl}/cogl-bitmap.h (100%) rename clutter/cogl/{common => cogl}/cogl-blend-string.c (100%) rename clutter/cogl/{common => cogl}/cogl-blend-string.h (100%) rename clutter/cogl/{common => cogl}/cogl-clip-stack.c (100%) rename clutter/cogl/{common => cogl}/cogl-clip-stack.h (100%) rename clutter/cogl/{common => cogl}/cogl-color.c (100%) rename clutter/cogl/{ => cogl}/cogl-color.h (100%) rename clutter/cogl/{common => cogl}/cogl-context.c (100%) rename clutter/cogl/{common => cogl}/cogl-context.h (100%) rename clutter/cogl/{common => cogl}/cogl-current-matrix.c (100%) rename clutter/cogl/{common => cogl}/cogl-current-matrix.h (100%) rename clutter/cogl/{common => cogl}/cogl-debug.c (100%) rename clutter/cogl/{ => cogl}/cogl-debug.h (100%) rename clutter/cogl/{ => cogl}/cogl-deprecated.h (100%) rename clutter/cogl/{common => cogl}/cogl-enum-types.c.in (100%) rename clutter/cogl/{common => cogl}/cogl-enum-types.h.in (100%) rename clutter/cogl/{common => cogl}/cogl-fixed.c (100%) rename clutter/cogl/{ => cogl}/cogl-fixed.h (100%) rename clutter/cogl/{common => cogl}/cogl-handle.h (100%) rename clutter/cogl/{common => cogl}/cogl-internal.h (100%) rename clutter/cogl/{common => cogl}/cogl-material-private.h (100%) rename clutter/cogl/{common => cogl}/cogl-material.c (100%) rename clutter/cogl/{ => cogl}/cogl-material.h (100%) rename clutter/cogl/{common => cogl}/cogl-matrix-stack.c (100%) rename clutter/cogl/{common => cogl}/cogl-matrix-stack.h (98%) rename clutter/cogl/{common => cogl}/cogl-matrix.c (100%) rename clutter/cogl/{ => cogl}/cogl-matrix.h (100%) rename clutter/cogl/{ => cogl}/cogl-offscreen.h (100%) rename clutter/cogl/{ => cogl}/cogl-path.h (100%) rename clutter/cogl/{common => cogl}/cogl-primitives.c (100%) rename clutter/cogl/{common => cogl}/cogl-primitives.h (96%) rename clutter/cogl/{ => cogl}/cogl-shader.h (100%) rename clutter/cogl/{common => cogl}/cogl-texture-driver.h (100%) rename clutter/cogl/{common => cogl}/cogl-texture-private.h (100%) rename clutter/cogl/{common => cogl}/cogl-texture.c (100%) rename clutter/cogl/{ => cogl}/cogl-texture.h (100%) rename clutter/cogl/{ => cogl}/cogl-types.h (100%) rename clutter/cogl/{common => cogl}/cogl-util.c (100%) rename clutter/cogl/{common => cogl}/cogl-util.h (100%) rename clutter/cogl/{common => cogl}/cogl-vertex-buffer-private.h (100%) rename clutter/cogl/{common => cogl}/cogl-vertex-buffer.c (100%) rename clutter/cogl/{ => cogl}/cogl-vertex-buffer.h (100%) rename clutter/cogl/{common => cogl}/cogl.c (97%) rename clutter/cogl/{ => cogl}/cogl.h.in (99%) create mode 100644 clutter/cogl/cogl/cogl.pc.in create mode 100644 clutter/cogl/cogl/driver/Makefile.am create mode 100644 clutter/cogl/cogl/driver/gl/Makefile.am rename clutter/cogl/{ => cogl/driver}/gl/cogl-context-driver.c (100%) rename clutter/cogl/{ => cogl/driver}/gl/cogl-context-driver.h (100%) rename clutter/cogl/{ => cogl/driver}/gl/cogl-defines.h.in (100%) rename clutter/cogl/{ => cogl/driver}/gl/cogl-fbo.c (100%) rename clutter/cogl/{ => cogl/driver}/gl/cogl-fbo.h (100%) rename clutter/cogl/{ => cogl/driver}/gl/cogl-primitives.c (100%) rename clutter/cogl/{ => cogl/driver}/gl/cogl-program.c (100%) rename clutter/cogl/{ => cogl/driver}/gl/cogl-program.h (100%) rename clutter/cogl/{ => cogl/driver}/gl/cogl-shader-private.h (100%) rename clutter/cogl/{ => cogl/driver}/gl/cogl-shader.c (100%) rename clutter/cogl/{ => cogl/driver}/gl/cogl-texture-driver.c (100%) rename clutter/cogl/{ => cogl/driver}/gl/cogl.c (89%) create mode 100644 clutter/cogl/cogl/driver/gles/Makefile.am rename clutter/cogl/{ => cogl/driver}/gles/cogl-context-driver.c (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-context-driver.h (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-defines.h.in (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-fbo.c (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-fbo.h (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-fixed-fragment-shader.glsl (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-fixed-vertex-shader.glsl (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-gles2-wrapper.c (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-gles2-wrapper.h (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-primitives.c (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-program.c (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-program.h (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-shader-private.h (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-shader.c (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-texture-driver.c (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-util.c (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl-util.h (100%) rename clutter/cogl/{ => cogl/driver}/gles/cogl.c (91%) rename clutter/cogl/{ => cogl/driver}/gles/stringify.sh (100%) rename clutter/cogl/{common => cogl}/stb_image.c (100%) create mode 100644 clutter/cogl/cogl/winsys/Makefile.am create mode 100644 clutter/cogl/cogl/winsys/cogl-eglnative.c create mode 100644 clutter/cogl/cogl/winsys/cogl-eglx.c create mode 100644 clutter/cogl/cogl/winsys/cogl-fruity.c create mode 100644 clutter/cogl/cogl/winsys/cogl-glx.c create mode 100644 clutter/cogl/cogl/winsys/cogl-osx.c create mode 100644 clutter/cogl/cogl/winsys/cogl-sdl.c create mode 100644 clutter/cogl/cogl/winsys/cogl-win32.c create mode 100644 clutter/cogl/cogl/winsys/cogl-winsys.h delete mode 100644 clutter/cogl/common/Makefile.am diff --git a/Makefile.am b/Makefile.am index b078d34fb..3300b4fb0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,15 +14,15 @@ ACLOCAL_AMFLAGS = -I build/autotools pcfiles = \ clutter-$(CLUTTER_API_VERSION).pc \ - clutter-$(CLUTTER_FLAVOUR)-$(CLUTTER_API_VERSION).pc \ + clutter-$(CLUTTER_WINSYS)-$(CLUTTER_API_VERSION).pc \ $(NULL) # clutter-..pc - for generic dependencies clutter-$(CLUTTER_API_VERSION).pc: clutter.pc $(QUIET_GEN)cp $< $@ -# clutter--..pc - for backend-specific dependencies -clutter-$(CLUTTER_FLAVOUR)-$(CLUTTER_API_VERSION).pc: clutter.pc +# clutter--..pc - for backend-specific dependencies +clutter-$(CLUTTER_WINSYS)-$(CLUTTER_API_VERSION).pc: clutter.pc $(QUIET_GEN)cp $< $@ .PHONY: test-report full-report @@ -32,8 +32,6 @@ test-report full-report: pkgconfig_DATA = $(pcfiles) pkgconfigdir = $(libdir)/pkgconfig -DEFAULT_FLAVOUR = @CLUTTER_FLAVOUR@ - EXTRA_DIST = \ ChangeLog.SVN \ clutter.pc.in \ diff --git a/clutter.pc.in b/clutter.pc.in index e75080cb7..f6d5904cc 100644 --- a/clutter.pc.in +++ b/clutter.pc.in @@ -2,14 +2,16 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -backend=@clutterbackend@ apiversion=@CLUTTER_API_VERSION@ requires=@CLUTTER_REQUIRES@ -cogl=@CLUTTER_COGL@ +backend=@CLUTTER_WINSYS@ #only kept for backward compatability +winsys=@CLUTTER_WINSYS@ +cogl=@COGL_DRIVER@ #only kept for backward compatability +cogl_driver=@COGL_DRIVER@ Name: Clutter -Description: Clutter Core Library (${backend} backend) +Description: Clutter Core Library (${winsys}/${cogl_driver} backend) Version: @VERSION@ -Libs: -L${libdir} -lclutter-${backend}-${apiversion} +Libs: -L${libdir} -lclutter-${winsys}-${apiversion} Cflags: -I${includedir}/clutter-${apiversion} Requires: ${requires} diff --git a/clutter/Makefile.am b/clutter/Makefile.am index 675bc0989..b19070f5a 100644 --- a/clutter/Makefile.am +++ b/clutter/Makefile.am @@ -2,7 +2,7 @@ include $(top_srcdir)/build/autotools/Makefile.am.silent NULL = -SUBDIRS = cogl pango $(backendextra) $(clutterbackend) +SUBDIRS = cogl pango $(CLUTTER_WINSYS_BASE) $(CLUTTER_WINSYS) if LOCAL_JSON_GLIB SUBDIRS += json @@ -14,8 +14,6 @@ endif DIST_SUBDIRS = pango glx eglx eglnative cogl sdl json osx x11 win32 fruity -target = $(clutterbackend) - # common definitions CLEANFILES = DISTCLEANFILES = @@ -28,6 +26,7 @@ INCLUDES = \ -I$(top_srcdir)/clutter/pango \ -I$(top_srcdir)/clutter \ $(clutter_json_include) \ + -I$(top_builddir)/clutter/cogl \ -I$(top_builddir)/clutter \ $(NULL) @@ -180,31 +179,31 @@ source_h_priv = \ $(srcdir)/clutter-timeout-interval.h \ $(NULL) -libclutter_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_LIBADD = \ +libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_LIBADD = \ $(CLUTTER_LIBS) \ - $(top_builddir)/clutter/cogl/libclutter-cogl.la \ + $(top_builddir)/clutter/cogl/cogl/libclutter-cogl.la \ $(top_builddir)/clutter/pango/libcoglpango.la \ - $(top_builddir)/clutter/$(CLUTTER_FLAVOUR)/libclutter-$(CLUTTER_FLAVOUR).la \ + $(top_builddir)/clutter/$(CLUTTER_WINSYS)/libclutter-$(CLUTTER_WINSYS).la \ $(clutter_json_libadd) \ - $(backendextralib) + $(CLUTTER_WINSYS_BASE_LIB) -libclutter_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_DEPENDENCIES = \ - $(top_builddir)/clutter/cogl/libclutter-cogl.la \ +libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_DEPENDENCIES = \ + $(top_builddir)/clutter/cogl/cogl/libclutter-cogl.la \ $(top_builddir)/clutter/pango/libcoglpango.la \ - $(top_builddir)/clutter/$(CLUTTER_FLAVOUR)/libclutter-$(CLUTTER_FLAVOUR).la \ + $(top_builddir)/clutter/$(CLUTTER_WINSYS)/libclutter-$(CLUTTER_WINSYS).la \ $(clutter_json_dep) \ - $(backendextralib) + $(CLUTTER_WINSYS_BASE_LIB) -libclutter_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_SOURCES = \ +libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_SOURCES = \ $(source_c) \ $(source_h) \ $(source_h_priv) -libclutter_@CLUTTER_FLAVOUR@_@CLUTTER_API_VERSION@_la_LDFLAGS = $(LDADD) +libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_LDFLAGS = $(LDADD) -lib_LTLIBRARIES = $(clutterbackendlib) +lib_LTLIBRARIES = $(CLUTTER_WINSYS_LIB) -EXTRA_LTLIBRARIES = libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@.la +EXTRA_LTLIBRARIES = libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la clutterdir = $(includedir)/clutter-$(CLUTTER_API_VERSION)/clutter clutter_HEADERS = \ @@ -229,11 +228,12 @@ endif # We can't reference the list of COGL header files, since they are in a # subdir Makefile.am, so just extract them from cogl.h instead. The doc # comments for COGL are in the headers, so we don't need the source files. -Clutter-@CLUTTER_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@.la - $(QUIET_GEN)$(INTROSPECTION_SCANNER) -v \ + +Clutter-@CLUTTER_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la + $(QUIET_GEN)$(INTROSPECTION_SCANNER) -v \ --namespace Clutter --nsversion=@CLUTTER_API_VERSION@ \ $(INCLUDES) \ - --add-include-path=cogl \ + --add-include-path=cogl/cogl \ $(json_gir_include_path) \ --c-include='clutter/clutter.h' \ --include=GL-1.0 \ @@ -242,7 +242,7 @@ Clutter-@CLUTTER_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libclutter-@CLUTTER_ --include=PangoCairo-1.0 \ --include=Cogl-@CLUTTER_API_VERSION@ \ $(json_gir_include) \ - --library=libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@.la \ + --library=libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la \ --libtool="$(top_builddir)/libtool" \ --pkg gobject-2.0 \ --pkg pango \ diff --git a/clutter/cogl/Makefile.am b/clutter/cogl/Makefile.am index 58f762fa1..e13c1b481 100644 --- a/clutter/cogl/Makefile.am +++ b/clutter/cogl/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/clutter/cogl/TODO b/clutter/cogl/TODO deleted file mode 100644 index e1e5d316c..000000000 --- a/clutter/cogl/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/clutter/cogl/cogl.pc.in b/clutter/cogl/cogl.pc.in deleted file mode 100644 index 87196733b..000000000 --- a/clutter/cogl/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/clutter/cogl/cogl/Makefile.am b/clutter/cogl/cogl/Makefile.am new file mode 100644 index 000000000..e9be04ab3 --- /dev/null +++ b/clutter/cogl/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/clutter/cogl/common/cogl-bitmap-fallback.c b/clutter/cogl/cogl/cogl-bitmap-fallback.c similarity index 100% rename from clutter/cogl/common/cogl-bitmap-fallback.c rename to clutter/cogl/cogl/cogl-bitmap-fallback.c diff --git a/clutter/cogl/common/cogl-bitmap-pixbuf.c b/clutter/cogl/cogl/cogl-bitmap-pixbuf.c similarity index 100% rename from clutter/cogl/common/cogl-bitmap-pixbuf.c rename to clutter/cogl/cogl/cogl-bitmap-pixbuf.c diff --git a/clutter/cogl/common/cogl-bitmap-private.h b/clutter/cogl/cogl/cogl-bitmap-private.h similarity index 100% rename from clutter/cogl/common/cogl-bitmap-private.h rename to clutter/cogl/cogl/cogl-bitmap-private.h diff --git a/clutter/cogl/common/cogl-bitmap.c b/clutter/cogl/cogl/cogl-bitmap.c similarity index 100% rename from clutter/cogl/common/cogl-bitmap.c rename to clutter/cogl/cogl/cogl-bitmap.c diff --git a/clutter/cogl/cogl-bitmap.h b/clutter/cogl/cogl/cogl-bitmap.h similarity index 100% rename from clutter/cogl/cogl-bitmap.h rename to clutter/cogl/cogl/cogl-bitmap.h diff --git a/clutter/cogl/common/cogl-blend-string.c b/clutter/cogl/cogl/cogl-blend-string.c similarity index 100% rename from clutter/cogl/common/cogl-blend-string.c rename to clutter/cogl/cogl/cogl-blend-string.c diff --git a/clutter/cogl/common/cogl-blend-string.h b/clutter/cogl/cogl/cogl-blend-string.h similarity index 100% rename from clutter/cogl/common/cogl-blend-string.h rename to clutter/cogl/cogl/cogl-blend-string.h diff --git a/clutter/cogl/common/cogl-clip-stack.c b/clutter/cogl/cogl/cogl-clip-stack.c similarity index 100% rename from clutter/cogl/common/cogl-clip-stack.c rename to clutter/cogl/cogl/cogl-clip-stack.c diff --git a/clutter/cogl/common/cogl-clip-stack.h b/clutter/cogl/cogl/cogl-clip-stack.h similarity index 100% rename from clutter/cogl/common/cogl-clip-stack.h rename to clutter/cogl/cogl/cogl-clip-stack.h diff --git a/clutter/cogl/common/cogl-color.c b/clutter/cogl/cogl/cogl-color.c similarity index 100% rename from clutter/cogl/common/cogl-color.c rename to clutter/cogl/cogl/cogl-color.c diff --git a/clutter/cogl/cogl-color.h b/clutter/cogl/cogl/cogl-color.h similarity index 100% rename from clutter/cogl/cogl-color.h rename to clutter/cogl/cogl/cogl-color.h diff --git a/clutter/cogl/common/cogl-context.c b/clutter/cogl/cogl/cogl-context.c similarity index 100% rename from clutter/cogl/common/cogl-context.c rename to clutter/cogl/cogl/cogl-context.c diff --git a/clutter/cogl/common/cogl-context.h b/clutter/cogl/cogl/cogl-context.h similarity index 100% rename from clutter/cogl/common/cogl-context.h rename to clutter/cogl/cogl/cogl-context.h diff --git a/clutter/cogl/common/cogl-current-matrix.c b/clutter/cogl/cogl/cogl-current-matrix.c similarity index 100% rename from clutter/cogl/common/cogl-current-matrix.c rename to clutter/cogl/cogl/cogl-current-matrix.c diff --git a/clutter/cogl/common/cogl-current-matrix.h b/clutter/cogl/cogl/cogl-current-matrix.h similarity index 100% rename from clutter/cogl/common/cogl-current-matrix.h rename to clutter/cogl/cogl/cogl-current-matrix.h diff --git a/clutter/cogl/common/cogl-debug.c b/clutter/cogl/cogl/cogl-debug.c similarity index 100% rename from clutter/cogl/common/cogl-debug.c rename to clutter/cogl/cogl/cogl-debug.c diff --git a/clutter/cogl/cogl-debug.h b/clutter/cogl/cogl/cogl-debug.h similarity index 100% rename from clutter/cogl/cogl-debug.h rename to clutter/cogl/cogl/cogl-debug.h diff --git a/clutter/cogl/cogl-deprecated.h b/clutter/cogl/cogl/cogl-deprecated.h similarity index 100% rename from clutter/cogl/cogl-deprecated.h rename to clutter/cogl/cogl/cogl-deprecated.h diff --git a/clutter/cogl/common/cogl-enum-types.c.in b/clutter/cogl/cogl/cogl-enum-types.c.in similarity index 100% rename from clutter/cogl/common/cogl-enum-types.c.in rename to clutter/cogl/cogl/cogl-enum-types.c.in diff --git a/clutter/cogl/common/cogl-enum-types.h.in b/clutter/cogl/cogl/cogl-enum-types.h.in similarity index 100% rename from clutter/cogl/common/cogl-enum-types.h.in rename to clutter/cogl/cogl/cogl-enum-types.h.in diff --git a/clutter/cogl/common/cogl-fixed.c b/clutter/cogl/cogl/cogl-fixed.c similarity index 100% rename from clutter/cogl/common/cogl-fixed.c rename to clutter/cogl/cogl/cogl-fixed.c diff --git a/clutter/cogl/cogl-fixed.h b/clutter/cogl/cogl/cogl-fixed.h similarity index 100% rename from clutter/cogl/cogl-fixed.h rename to clutter/cogl/cogl/cogl-fixed.h diff --git a/clutter/cogl/common/cogl-handle.h b/clutter/cogl/cogl/cogl-handle.h similarity index 100% rename from clutter/cogl/common/cogl-handle.h rename to clutter/cogl/cogl/cogl-handle.h diff --git a/clutter/cogl/common/cogl-internal.h b/clutter/cogl/cogl/cogl-internal.h similarity index 100% rename from clutter/cogl/common/cogl-internal.h rename to clutter/cogl/cogl/cogl-internal.h diff --git a/clutter/cogl/common/cogl-material-private.h b/clutter/cogl/cogl/cogl-material-private.h similarity index 100% rename from clutter/cogl/common/cogl-material-private.h rename to clutter/cogl/cogl/cogl-material-private.h diff --git a/clutter/cogl/common/cogl-material.c b/clutter/cogl/cogl/cogl-material.c similarity index 100% rename from clutter/cogl/common/cogl-material.c rename to clutter/cogl/cogl/cogl-material.c diff --git a/clutter/cogl/cogl-material.h b/clutter/cogl/cogl/cogl-material.h similarity index 100% rename from clutter/cogl/cogl-material.h rename to clutter/cogl/cogl/cogl-material.h diff --git a/clutter/cogl/common/cogl-matrix-stack.c b/clutter/cogl/cogl/cogl-matrix-stack.c similarity index 100% rename from clutter/cogl/common/cogl-matrix-stack.c rename to clutter/cogl/cogl/cogl-matrix-stack.c diff --git a/clutter/cogl/common/cogl-matrix-stack.h b/clutter/cogl/cogl/cogl-matrix-stack.h similarity index 98% rename from clutter/cogl/common/cogl-matrix-stack.h rename to clutter/cogl/cogl/cogl-matrix-stack.h index c2d0048f5..1762eda95 100644 --- a/clutter/cogl/common/cogl-matrix-stack.h +++ b/clutter/cogl/cogl/cogl-matrix-stack.h @@ -27,7 +27,8 @@ #ifndef __COGL_MATRIX_STACK_H #define __COGL_MATRIX_STACK_H -#include +#include "cogl-matrix.h" +#include "cogl.h" /* needed for GLenum */ typedef struct _CoglMatrixStack CoglMatrixStack; diff --git a/clutter/cogl/common/cogl-matrix.c b/clutter/cogl/cogl/cogl-matrix.c similarity index 100% rename from clutter/cogl/common/cogl-matrix.c rename to clutter/cogl/cogl/cogl-matrix.c diff --git a/clutter/cogl/cogl-matrix.h b/clutter/cogl/cogl/cogl-matrix.h similarity index 100% rename from clutter/cogl/cogl-matrix.h rename to clutter/cogl/cogl/cogl-matrix.h diff --git a/clutter/cogl/cogl-offscreen.h b/clutter/cogl/cogl/cogl-offscreen.h similarity index 100% rename from clutter/cogl/cogl-offscreen.h rename to clutter/cogl/cogl/cogl-offscreen.h diff --git a/clutter/cogl/cogl-path.h b/clutter/cogl/cogl/cogl-path.h similarity index 100% rename from clutter/cogl/cogl-path.h rename to clutter/cogl/cogl/cogl-path.h diff --git a/clutter/cogl/common/cogl-primitives.c b/clutter/cogl/cogl/cogl-primitives.c similarity index 100% rename from clutter/cogl/common/cogl-primitives.c rename to clutter/cogl/cogl/cogl-primitives.c diff --git a/clutter/cogl/common/cogl-primitives.h b/clutter/cogl/cogl/cogl-primitives.h similarity index 96% rename from clutter/cogl/common/cogl-primitives.h rename to clutter/cogl/cogl/cogl-primitives.h index dd5a73c8b..c2d76d62a 100644 --- a/clutter/cogl/common/cogl-primitives.h +++ b/clutter/cogl/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/clutter/cogl/cogl-shader.h b/clutter/cogl/cogl/cogl-shader.h similarity index 100% rename from clutter/cogl/cogl-shader.h rename to clutter/cogl/cogl/cogl-shader.h diff --git a/clutter/cogl/common/cogl-texture-driver.h b/clutter/cogl/cogl/cogl-texture-driver.h similarity index 100% rename from clutter/cogl/common/cogl-texture-driver.h rename to clutter/cogl/cogl/cogl-texture-driver.h diff --git a/clutter/cogl/common/cogl-texture-private.h b/clutter/cogl/cogl/cogl-texture-private.h similarity index 100% rename from clutter/cogl/common/cogl-texture-private.h rename to clutter/cogl/cogl/cogl-texture-private.h diff --git a/clutter/cogl/common/cogl-texture.c b/clutter/cogl/cogl/cogl-texture.c similarity index 100% rename from clutter/cogl/common/cogl-texture.c rename to clutter/cogl/cogl/cogl-texture.c diff --git a/clutter/cogl/cogl-texture.h b/clutter/cogl/cogl/cogl-texture.h similarity index 100% rename from clutter/cogl/cogl-texture.h rename to clutter/cogl/cogl/cogl-texture.h diff --git a/clutter/cogl/cogl-types.h b/clutter/cogl/cogl/cogl-types.h similarity index 100% rename from clutter/cogl/cogl-types.h rename to clutter/cogl/cogl/cogl-types.h diff --git a/clutter/cogl/common/cogl-util.c b/clutter/cogl/cogl/cogl-util.c similarity index 100% rename from clutter/cogl/common/cogl-util.c rename to clutter/cogl/cogl/cogl-util.c diff --git a/clutter/cogl/common/cogl-util.h b/clutter/cogl/cogl/cogl-util.h similarity index 100% rename from clutter/cogl/common/cogl-util.h rename to clutter/cogl/cogl/cogl-util.h diff --git a/clutter/cogl/common/cogl-vertex-buffer-private.h b/clutter/cogl/cogl/cogl-vertex-buffer-private.h similarity index 100% rename from clutter/cogl/common/cogl-vertex-buffer-private.h rename to clutter/cogl/cogl/cogl-vertex-buffer-private.h diff --git a/clutter/cogl/common/cogl-vertex-buffer.c b/clutter/cogl/cogl/cogl-vertex-buffer.c similarity index 100% rename from clutter/cogl/common/cogl-vertex-buffer.c rename to clutter/cogl/cogl/cogl-vertex-buffer.c diff --git a/clutter/cogl/cogl-vertex-buffer.h b/clutter/cogl/cogl/cogl-vertex-buffer.h similarity index 100% rename from clutter/cogl/cogl-vertex-buffer.h rename to clutter/cogl/cogl/cogl-vertex-buffer.h diff --git a/clutter/cogl/common/cogl.c b/clutter/cogl/cogl/cogl.c similarity index 97% rename from clutter/cogl/common/cogl.c rename to clutter/cogl/cogl/cogl.c index 85e937030..e16637e32 100644 --- a/clutter/cogl/common/cogl.c +++ b/clutter/cogl/cogl/cogl.c @@ -30,19 +30,14 @@ #include #include #include - -#ifdef HAVE_CLUTTER_GLX -#include -#include - -typedef CoglFuncPtr (*GLXGetProcAddressProc) (const guint8 *procName); -#endif +#include #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/clutter/cogl/cogl.h.in b/clutter/cogl/cogl/cogl.h.in similarity index 99% rename from clutter/cogl/cogl.h.in rename to clutter/cogl/cogl/cogl.h.in index 9d3876913..524aec71d 100644 --- a/clutter/cogl/cogl.h.in +++ b/clutter/cogl/cogl/cogl.h.in @@ -29,7 +29,7 @@ #define __COGL_H_INSIDE__ -#include +#include #include #include diff --git a/clutter/cogl/cogl/cogl.pc.in b/clutter/cogl/cogl/cogl.pc.in new file mode 100644 index 000000000..7975f4f3a --- /dev/null +++ b/clutter/cogl/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/clutter/cogl/cogl/driver/Makefile.am b/clutter/cogl/cogl/driver/Makefile.am new file mode 100644 index 000000000..e39b278ec --- /dev/null +++ b/clutter/cogl/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/clutter/cogl/cogl/driver/gl/Makefile.am b/clutter/cogl/cogl/driver/gl/Makefile.am new file mode 100644 index 000000000..81a21c90e --- /dev/null +++ b/clutter/cogl/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/clutter/cogl/gl/cogl-context-driver.c b/clutter/cogl/cogl/driver/gl/cogl-context-driver.c similarity index 100% rename from clutter/cogl/gl/cogl-context-driver.c rename to clutter/cogl/cogl/driver/gl/cogl-context-driver.c diff --git a/clutter/cogl/gl/cogl-context-driver.h b/clutter/cogl/cogl/driver/gl/cogl-context-driver.h similarity index 100% rename from clutter/cogl/gl/cogl-context-driver.h rename to clutter/cogl/cogl/driver/gl/cogl-context-driver.h diff --git a/clutter/cogl/gl/cogl-defines.h.in b/clutter/cogl/cogl/driver/gl/cogl-defines.h.in similarity index 100% rename from clutter/cogl/gl/cogl-defines.h.in rename to clutter/cogl/cogl/driver/gl/cogl-defines.h.in diff --git a/clutter/cogl/gl/cogl-fbo.c b/clutter/cogl/cogl/driver/gl/cogl-fbo.c similarity index 100% rename from clutter/cogl/gl/cogl-fbo.c rename to clutter/cogl/cogl/driver/gl/cogl-fbo.c diff --git a/clutter/cogl/gl/cogl-fbo.h b/clutter/cogl/cogl/driver/gl/cogl-fbo.h similarity index 100% rename from clutter/cogl/gl/cogl-fbo.h rename to clutter/cogl/cogl/driver/gl/cogl-fbo.h diff --git a/clutter/cogl/gl/cogl-primitives.c b/clutter/cogl/cogl/driver/gl/cogl-primitives.c similarity index 100% rename from clutter/cogl/gl/cogl-primitives.c rename to clutter/cogl/cogl/driver/gl/cogl-primitives.c diff --git a/clutter/cogl/gl/cogl-program.c b/clutter/cogl/cogl/driver/gl/cogl-program.c similarity index 100% rename from clutter/cogl/gl/cogl-program.c rename to clutter/cogl/cogl/driver/gl/cogl-program.c diff --git a/clutter/cogl/gl/cogl-program.h b/clutter/cogl/cogl/driver/gl/cogl-program.h similarity index 100% rename from clutter/cogl/gl/cogl-program.h rename to clutter/cogl/cogl/driver/gl/cogl-program.h diff --git a/clutter/cogl/gl/cogl-shader-private.h b/clutter/cogl/cogl/driver/gl/cogl-shader-private.h similarity index 100% rename from clutter/cogl/gl/cogl-shader-private.h rename to clutter/cogl/cogl/driver/gl/cogl-shader-private.h diff --git a/clutter/cogl/gl/cogl-shader.c b/clutter/cogl/cogl/driver/gl/cogl-shader.c similarity index 100% rename from clutter/cogl/gl/cogl-shader.c rename to clutter/cogl/cogl/driver/gl/cogl-shader.c diff --git a/clutter/cogl/gl/cogl-texture-driver.c b/clutter/cogl/cogl/driver/gl/cogl-texture-driver.c similarity index 100% rename from clutter/cogl/gl/cogl-texture-driver.c rename to clutter/cogl/cogl/driver/gl/cogl-texture-driver.c diff --git a/clutter/cogl/gl/cogl.c b/clutter/cogl/cogl/driver/gl/cogl.c similarity index 89% rename from clutter/cogl/gl/cogl.c rename to clutter/cogl/cogl/driver/gl/cogl.c index 841981549..04d3b750a 100644 --- a/clutter/cogl/gl/cogl.c +++ b/clutter/cogl/cogl/driver/gl/cogl.c @@ -26,84 +26,12 @@ #endif #include -#include #include "cogl.h" -#ifdef HAVE_CLUTTER_GLX -#include -#include - -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/clutter/cogl/cogl/driver/gles/Makefile.am b/clutter/cogl/cogl/driver/gles/Makefile.am new file mode 100644 index 000000000..df126c049 --- /dev/null +++ b/clutter/cogl/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/clutter/cogl/gles/cogl-context-driver.c b/clutter/cogl/cogl/driver/gles/cogl-context-driver.c similarity index 100% rename from clutter/cogl/gles/cogl-context-driver.c rename to clutter/cogl/cogl/driver/gles/cogl-context-driver.c diff --git a/clutter/cogl/gles/cogl-context-driver.h b/clutter/cogl/cogl/driver/gles/cogl-context-driver.h similarity index 100% rename from clutter/cogl/gles/cogl-context-driver.h rename to clutter/cogl/cogl/driver/gles/cogl-context-driver.h diff --git a/clutter/cogl/gles/cogl-defines.h.in b/clutter/cogl/cogl/driver/gles/cogl-defines.h.in similarity index 100% rename from clutter/cogl/gles/cogl-defines.h.in rename to clutter/cogl/cogl/driver/gles/cogl-defines.h.in diff --git a/clutter/cogl/gles/cogl-fbo.c b/clutter/cogl/cogl/driver/gles/cogl-fbo.c similarity index 100% rename from clutter/cogl/gles/cogl-fbo.c rename to clutter/cogl/cogl/driver/gles/cogl-fbo.c diff --git a/clutter/cogl/gles/cogl-fbo.h b/clutter/cogl/cogl/driver/gles/cogl-fbo.h similarity index 100% rename from clutter/cogl/gles/cogl-fbo.h rename to clutter/cogl/cogl/driver/gles/cogl-fbo.h diff --git a/clutter/cogl/gles/cogl-fixed-fragment-shader.glsl b/clutter/cogl/cogl/driver/gles/cogl-fixed-fragment-shader.glsl similarity index 100% rename from clutter/cogl/gles/cogl-fixed-fragment-shader.glsl rename to clutter/cogl/cogl/driver/gles/cogl-fixed-fragment-shader.glsl diff --git a/clutter/cogl/gles/cogl-fixed-vertex-shader.glsl b/clutter/cogl/cogl/driver/gles/cogl-fixed-vertex-shader.glsl similarity index 100% rename from clutter/cogl/gles/cogl-fixed-vertex-shader.glsl rename to clutter/cogl/cogl/driver/gles/cogl-fixed-vertex-shader.glsl diff --git a/clutter/cogl/gles/cogl-gles2-wrapper.c b/clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.c similarity index 100% rename from clutter/cogl/gles/cogl-gles2-wrapper.c rename to clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.c diff --git a/clutter/cogl/gles/cogl-gles2-wrapper.h b/clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.h similarity index 100% rename from clutter/cogl/gles/cogl-gles2-wrapper.h rename to clutter/cogl/cogl/driver/gles/cogl-gles2-wrapper.h diff --git a/clutter/cogl/gles/cogl-primitives.c b/clutter/cogl/cogl/driver/gles/cogl-primitives.c similarity index 100% rename from clutter/cogl/gles/cogl-primitives.c rename to clutter/cogl/cogl/driver/gles/cogl-primitives.c diff --git a/clutter/cogl/gles/cogl-program.c b/clutter/cogl/cogl/driver/gles/cogl-program.c similarity index 100% rename from clutter/cogl/gles/cogl-program.c rename to clutter/cogl/cogl/driver/gles/cogl-program.c diff --git a/clutter/cogl/gles/cogl-program.h b/clutter/cogl/cogl/driver/gles/cogl-program.h similarity index 100% rename from clutter/cogl/gles/cogl-program.h rename to clutter/cogl/cogl/driver/gles/cogl-program.h diff --git a/clutter/cogl/gles/cogl-shader-private.h b/clutter/cogl/cogl/driver/gles/cogl-shader-private.h similarity index 100% rename from clutter/cogl/gles/cogl-shader-private.h rename to clutter/cogl/cogl/driver/gles/cogl-shader-private.h diff --git a/clutter/cogl/gles/cogl-shader.c b/clutter/cogl/cogl/driver/gles/cogl-shader.c similarity index 100% rename from clutter/cogl/gles/cogl-shader.c rename to clutter/cogl/cogl/driver/gles/cogl-shader.c diff --git a/clutter/cogl/gles/cogl-texture-driver.c b/clutter/cogl/cogl/driver/gles/cogl-texture-driver.c similarity index 100% rename from clutter/cogl/gles/cogl-texture-driver.c rename to clutter/cogl/cogl/driver/gles/cogl-texture-driver.c diff --git a/clutter/cogl/gles/cogl-util.c b/clutter/cogl/cogl/driver/gles/cogl-util.c similarity index 100% rename from clutter/cogl/gles/cogl-util.c rename to clutter/cogl/cogl/driver/gles/cogl-util.c diff --git a/clutter/cogl/gles/cogl-util.h b/clutter/cogl/cogl/driver/gles/cogl-util.h similarity index 100% rename from clutter/cogl/gles/cogl-util.h rename to clutter/cogl/cogl/driver/gles/cogl-util.h diff --git a/clutter/cogl/gles/cogl.c b/clutter/cogl/cogl/driver/gles/cogl.c similarity index 91% rename from clutter/cogl/gles/cogl.c rename to clutter/cogl/cogl/driver/gles/cogl.c index 0fcf4fc3b..aa7da6ef2 100644 --- a/clutter/cogl/gles/cogl.c +++ b/clutter/cogl/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/clutter/cogl/gles/stringify.sh b/clutter/cogl/cogl/driver/gles/stringify.sh similarity index 100% rename from clutter/cogl/gles/stringify.sh rename to clutter/cogl/cogl/driver/gles/stringify.sh diff --git a/clutter/cogl/common/stb_image.c b/clutter/cogl/cogl/stb_image.c similarity index 100% rename from clutter/cogl/common/stb_image.c rename to clutter/cogl/cogl/stb_image.c diff --git a/clutter/cogl/cogl/winsys/Makefile.am b/clutter/cogl/cogl/winsys/Makefile.am new file mode 100644 index 000000000..684da4aec --- /dev/null +++ b/clutter/cogl/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/clutter/cogl/cogl/winsys/cogl-eglnative.c b/clutter/cogl/cogl/winsys/cogl-eglnative.c new file mode 100644 index 000000000..3bf5b0fbb --- /dev/null +++ b/clutter/cogl/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/clutter/cogl/cogl/winsys/cogl-eglx.c b/clutter/cogl/cogl/winsys/cogl-eglx.c new file mode 100644 index 000000000..3bf5b0fbb --- /dev/null +++ b/clutter/cogl/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/clutter/cogl/cogl/winsys/cogl-fruity.c b/clutter/cogl/cogl/winsys/cogl-fruity.c new file mode 100644 index 000000000..3bf5b0fbb --- /dev/null +++ b/clutter/cogl/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/clutter/cogl/cogl/winsys/cogl-glx.c b/clutter/cogl/cogl/winsys/cogl-glx.c new file mode 100644 index 000000000..fb5131227 --- /dev/null +++ b/clutter/cogl/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 +#include + +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/clutter/cogl/cogl/winsys/cogl-osx.c b/clutter/cogl/cogl/winsys/cogl-osx.c new file mode 100644 index 000000000..3bf5b0fbb --- /dev/null +++ b/clutter/cogl/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/clutter/cogl/cogl/winsys/cogl-sdl.c b/clutter/cogl/cogl/winsys/cogl-sdl.c new file mode 100644 index 000000000..3bf5b0fbb --- /dev/null +++ b/clutter/cogl/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/clutter/cogl/cogl/winsys/cogl-win32.c b/clutter/cogl/cogl/winsys/cogl-win32.c new file mode 100644 index 000000000..8c1ac9cce --- /dev/null +++ b/clutter/cogl/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/clutter/cogl/cogl/winsys/cogl-winsys.h b/clutter/cogl/cogl/winsys/cogl-winsys.h new file mode 100644 index 000000000..ab83c29ab --- /dev/null +++ b/clutter/cogl/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/clutter/cogl/common/Makefile.am b/clutter/cogl/common/Makefile.am deleted file mode 100644 index ef1c342f1..000000000 --- a/clutter/cogl/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/clutter/eglnative/Makefile.am b/clutter/eglnative/Makefile.am index 6bbd241e5..e3647ff50 100644 --- a/clutter/eglnative/Makefile.am +++ b/clutter/eglnative/Makefile.am @@ -2,11 +2,13 @@ libclutterincludedir = $(includedir)/clutter-@CLUTTER_API_VERSION@/clutter libclutterinclude_HEADERS = clutter-egl.h INCLUDES = \ - -DG_LOG_DOMAIN=\"ClutterEGL\" \ - -DCLUTTER_COMPILATION \ - -I$(top_srcdir) \ - -I$(top_srcdir)/clutter \ - -I$(top_builddir)/clutter + -DG_LOG_DOMAIN=\"ClutterEGL\" \ + -DCLUTTER_COMPILATION \ + -I$(top_srcdir) \ + -I$(top_srcdir)/clutter \ + -I$(top_srcdir)/clutter/cogl \ + -I$(top_builddir)/clutter \ + -I$(top_builddir)/clutter/cogl common_ldadd = $(CLUTTER_LIBS) diff --git a/clutter/eglx/Makefile.am b/clutter/eglx/Makefile.am index 8c05ce4ea..37e476645 100644 --- a/clutter/eglx/Makefile.am +++ b/clutter/eglx/Makefile.am @@ -6,8 +6,10 @@ INCLUDES = \ -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ + -I$(top_srcdir)/clutter/cogl \ -I$(top_srcdir)/clutter/x11 \ -I$(top_builddir)/clutter \ + -I$(top_builddir)/clutter/cogl \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ $(MAINTAINER_CFLAGS) diff --git a/clutter/fruity/Makefile.am b/clutter/fruity/Makefile.am index 56e688347..9fc83d9a8 100644 --- a/clutter/fruity/Makefile.am +++ b/clutter/fruity/Makefile.am @@ -1,11 +1,13 @@ libclutterincludedir = $(includedir)/clutter-@CLUTTER_API_VERSION@/clutter INCLUDES = \ - -DG_LOG_DOMAIN=\"ClutterFruity\" \ + -DG_LOG_DOMAIN=\"ClutterFruity\" \ -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ - -I$(top_srcdir)/clutter \ - -I$(top_builddir)/clutter + -I$(top_srcdir)/clutter \ + -I$(top_srcdir)/clutter/cogl \ + -I$(top_builddir)/clutter \ + -I$(top_builddir)/clutter/cogl common_ldadd = $(CLUTTER_LIBS) diff --git a/clutter/glx/Makefile.am b/clutter/glx/Makefile.am index 540d21279..649915aaa 100644 --- a/clutter/glx/Makefile.am +++ b/clutter/glx/Makefile.am @@ -7,8 +7,10 @@ INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterGLX\" \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ + -I$(top_srcdir)/clutter/cogl \ -I$(top_srcdir)/clutter/x11 \ -I$(top_builddir)/clutter \ + -I$(top_builddir)/clutter/cogl \ -DCLUTTER_COMPILATION \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ diff --git a/clutter/osx/Makefile.am b/clutter/osx/Makefile.am index 0594651bd..b35b79205 100644 --- a/clutter/osx/Makefile.am +++ b/clutter/osx/Makefile.am @@ -3,10 +3,12 @@ libclutterinclude_HEADERS = clutter-osx.h INCLUDES = \ -DG_LOG_DOMAIN=\"ClutterOSX\" \ - -DCLUTTER_COMPILATION \ + -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ - -I$(top_builddir)/clutter + -I$(top_srcdir)/clutter/cogl \ + -I$(top_builddir)/clutter \ + -I$(top_builddir)/clutter/cogl common_ldadd = $(CLUTTER_LIBS) diff --git a/clutter/sdl/Makefile.am b/clutter/sdl/Makefile.am index 92d1b1f55..084653afb 100644 --- a/clutter/sdl/Makefile.am +++ b/clutter/sdl/Makefile.am @@ -6,7 +6,9 @@ INCLUDES = \ -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter/ \ + -I$(top_srcdir)/clutter/cogl \ -I$(top_builddir)/clutter/ \ + -I$(top_builddir)/clutter/cogl \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ $(MAINTAINER_CFLAGS) diff --git a/clutter/win32/Makefile.am b/clutter/win32/Makefile.am index d4fa60cb1..41c31d067 100644 --- a/clutter/win32/Makefile.am +++ b/clutter/win32/Makefile.am @@ -12,7 +12,9 @@ INCLUDES = \ -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ + -I$(top_srcdir)/clutter/cogl \ -I$(top_builddir)/clutter \ + -I$(top_builddir)/clutter/cogl \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ $(MAINTAINER_CFLAGS) diff --git a/clutter/win32/clutter-win32.pc.in b/clutter/win32/clutter-win32.pc.in index 824da440a..ad9a2b40c 100644 --- a/clutter/win32/clutter-win32.pc.in +++ b/clutter/win32/clutter-win32.pc.in @@ -2,13 +2,15 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -backend=@clutterbackend@ apiversion=@CLUTTER_API_VERSION@ requires=@CLUTTER_REQUIRES@ +backend=@CLUTTER_WINSYS@ #only kept for backward compatability +winsys=@CLUTTER_WINSYS@ +cogl_driver=@COGL_DRIVER@ Name: Clutter -Description: Clutter Core Library (${backend} backend) +Description: Clutter Core Library (${winsys}/${cogl_driver} backend) Version: @VERSION@ -Libs: -L${libdir} -lclutter-${backend}-${apiversion} +Libs: -L${libdir} -lclutter-${winsys}-${apiversion} Cflags: -I${includedir}/clutter-${apiversion} Requires: ${requires} diff --git a/clutter/x11/Makefile.am b/clutter/x11/Makefile.am index 814780a94..175f65d8b 100644 --- a/clutter/x11/Makefile.am +++ b/clutter/x11/Makefile.am @@ -5,7 +5,9 @@ INCLUDES = \ -DCLUTTER_COMPILATION \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ + -I$(top_srcdir)/clutter/cogl \ -I$(top_builddir)/clutter \ + -I$(top_builddir)/clutter/cogl \ $(CLUTTER_CFLAGS) \ $(CLUTTER_DEBUG_CFLAGS) \ $(MAINTAINER_CFLAGS) diff --git a/clutter/x11/clutter-x11.pc.in b/clutter/x11/clutter-x11.pc.in index c6fa3c031..ad9a2b40c 100644 --- a/clutter/x11/clutter-x11.pc.in +++ b/clutter/x11/clutter-x11.pc.in @@ -2,13 +2,15 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ -backend=@clutterbackend@ apiversion=@CLUTTER_API_VERSION@ requires=@CLUTTER_REQUIRES@ +backend=@CLUTTER_WINSYS@ #only kept for backward compatability +winsys=@CLUTTER_WINSYS@ +cogl_driver=@COGL_DRIVER@ Name: Clutter -Description: Clutter Core Library (${backend} backend) +Description: Clutter Core Library (${winsys}/${cogl_driver} backend) Version: @VERSION@ -Libs: -L${libdir} -lclutter-${backend}-${apiversion} +Libs: -L${libdir} -lclutter-${winsys}-${apiversion} Cflags: -I${includedir}/clutter-${apiversion} -Requires: ${requires} \ No newline at end of file +Requires: ${requires} diff --git a/configure.ac b/configure.ac index 079bbc7b7..cf875df13 100644 --- a/configure.ac +++ b/configure.ac @@ -104,9 +104,9 @@ PKG_PROG_PKG_CONFIG dnl ======================================================================== # defaults -backendextra= -backendextralib= -clutterbackend=glx +CLUTTER_WINSYS_BASE= +CLUTTER_WINSYS_BASE_LIB= +CLUTTER_WINSYS=glx clutter_gl_header="" glesversion=1.1 use_gles2_wrapper=no @@ -115,8 +115,8 @@ experimental_image=no AC_ARG_WITH([flavour], [AC_HELP_STRING([--with-flavour=@<:@glx/eglx/eglnative/sdl/osx/win32/fruity@:>@], - [Select the Clutter backend])], - [clutterbackend=$with_flavour]) + [Select the Clutter window system backend])], + [CLUTTER_WINSYS=$with_flavour]) AC_ARG_WITH([gles], [AC_HELP_STRING([--with-gles=@<:@1.1/2.0@:>@], @@ -124,7 +124,7 @@ AC_ARG_WITH([gles], [glesversion=$with_gles]) # the fruity backend requires a different handling for GLES -AS_IF([test "x$clutterbackend" = "xfruity"], [glesversion=fruity]) +AS_IF([test "x$CLUTTER_WINSYS" = "xfruity"], [glesversion=fruity]) # backend specific pkg-config files BACKEND_PC_FILES="" @@ -135,9 +135,9 @@ AM_CONDITIONAL(HAVE_LIBDL, [test "x$HAVE_LIBDL" = "xyes"]) dnl === COGL GLES backend ===================================================== -AS_IF([test "x$clutterbackend" = "xeglnative" || - test "x$clutterbackend" = "xeglx" || - test "x$clutterbackend" = "xfruity"], +AS_IF([test "x$CLUTTER_WINSYS" = "xeglnative" || + test "x$CLUTTER_WINSYS" = "xeglx" || + test "x$CLUTTER_WINSYS" = "xfruity"], [ AS_CASE([$glesversion], @@ -146,7 +146,7 @@ AS_IF([test "x$clutterbackend" = "xeglnative" || [ clutter_gl_header="GLES/gl.h" - CLUTTER_COGL="gles" + COGL_DRIVER="gles" AC_DEFINE([HAVE_COGL_GLES], 1, [Have GL/ES for rendering]) AC_SUBST(COGL_GLES_VERSION, [COGL_HAS_GLES1]) @@ -191,7 +191,7 @@ AS_IF([test "x$clutterbackend" = "xeglnative" || [ clutter_gl_header="GLES2/gl2.h" use_gles2_wrapper=yes - CLUTTER_COGL="gles" + COGL_DRIVER="gles" AC_DEFINE([HAVE_COGL_GLES2], 1, [Have GL/ES for rendering]) AC_SUBST(COGL_GLES_VERSION, [COGL_HAS_GLES2]) @@ -205,7 +205,7 @@ AS_IF([test "x$clutterbackend" = "xeglnative" || [fruity], [ clutter_gl_header="GLES/gl.h" - CLUTTER_COGL="gles" + COGL_DRIVER="gles" AC_DEFINE([HAVE_COGL_GLES], 1, [Have GL/ES for rendering]) AC_SUBST(COGL_GLES_VERSION, [COGL_HAS_GLES1]) @@ -223,17 +223,16 @@ AM_CONDITIONAL(USE_GLES2_WRAPPER, [test "x$use_gles2_wrapper" = "xyes"]) dnl === Clutter windowing system backend ====================================== -AS_CASE([$clutterbackend], +AS_CASE([$CLUTTER_WINSYS], [sdl], [ experimental_backend="yes" clutter_gl_header="GL/gl.h" - CLUTTER_FLAVOUR="sdl" CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_SDL" AC_DEFINE([HAVE_CLUTTER_SDL], [1], [Have the SDL backend]) - CLUTTER_COGL="gl" + COGL_DRIVER="gl" AC_DEFINE([HAVE_COGL_GL], [1], [Have GL for rendering]) AC_PATH_PROG(SDL_CONFIG, [sdl-config]) @@ -265,11 +264,10 @@ AS_CASE([$clutterbackend], [glx], [ clutter_gl_header="GL/gl.h" - CLUTTER_FLAVOUR="glx" CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_GLX" AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend]) - CLUTTER_COGL="gl" + COGL_DRIVER="gl" AC_DEFINE([HAVE_COGL_GL], [1], [Have GL for rendering]) AC_CHECK_HEADERS([GL/glx.h], @@ -283,8 +281,8 @@ AS_CASE([$clutterbackend], GLX_LIBS="$X11_LIBS -lGL" GLX_CFLAGS="$X11_CFLAGS" - backendextra=x11 - backendextralib="x11/libclutter-x11.la" + CLUTTER_WINSYS_BASE=x11 + CLUTTER_WINSYS_BASE_LIB="x11/libclutter-x11.la" # Mesa 7.3 added a GL pkg-config file, finally PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], []) @@ -293,15 +291,14 @@ AS_CASE([$clutterbackend], [eglx], [ # the GL header is defined in the COGL checks above - CLUTTER_FLAVOUR="eglx" CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_EGL" AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend]) EGL_LIBS="$GLES_LIBS $X11_LIBS" EGL_CFLAGS="$GLES_CFLAGS $X11_CFLAGS" - backendextra=x11 - backendextralib="x11/libclutter-x11.la" + CLUTTER_WINSYS_BASE=x11 + CLUTTER_WINSYS_BASE_LIB="x11/libclutter-x11.la" # Mesa 7.3 added a GL pkg-config file, finally PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], []) @@ -310,7 +307,6 @@ AS_CASE([$clutterbackend], [eglnative], [ # the GL header is defined in the COGL checks above - CLUTTER_FLAVOUR="eglnative" CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_EGLNATIVE" AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend]) @@ -327,7 +323,6 @@ AS_CASE([$clutterbackend], [ experimental_backend="yes" # the GL header is defined in the COGL checks above - CLUTTER_FLAVOUR="fruity" CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_FRUITY" AC_DEFINE([HAVE_CLUTTER_FRUITY], [1], [Have the Fruity backend]) @@ -339,11 +334,10 @@ AS_CASE([$clutterbackend], [ experimental_backend="yes" clutter_gl_header="OpenGL/gl.h" - CLUTTER_FLAVOUR="osx" CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_OSX" AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend]) - CLUTTER_COGL="gl" + COGL_DRIVER="gl" AC_DEFINE([HAVE_COGL_GL], [1], [Have GL for rendering]) OSX_LIBS="-framework Cocoa -framework OpenGL" @@ -352,11 +346,10 @@ AS_CASE([$clutterbackend], [win32], [ clutter_gl_header="GL/gl.h" - CLUTTER_FLAVOUR="win32" CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_WIN32" AC_DEFINE([HAVE_CLUTTER_WIN32], [1], [Have the Win32 backend]) - CLUTTER_COGL="gl" + COGL_DRIVER="gl" AC_DEFINE([HAVE_COGL_GL], [1], [Have GL for rendering]) WIN32_CFLAGS="-D_WIN32_WINNT=0x0500" @@ -375,31 +368,45 @@ AC_CHECK_HEADERS([$clutter_gl_header], CLUTTER_GL_HEADER=$clutter_gl_header -AC_SUBST([clutterbackend]) -AC_SUBST([imagebackend]) -AC_SUBST([backendextra]) -AC_SUBST([backendextralib]) -AC_SUBST(CLUTTER_FLAVOUR) -AC_SUBST(CLUTTER_COGL) + +dnl === Clutter substitutions ================================================= +# Eventually the idea of a winsys should be hidden from Clutter and moved +# into Cogl, but for now we have CLUTTER_WINSYS... +AC_SUBST([CLUTTER_WINSYS]) +# The same goes for the winsys-base... +AC_SUBST([CLUTTER_WINSYS_BASE]) +AC_SUBST([CLUTTER_WINSYS_BASE_LIB]) AC_SUBST(CLUTTER_GL_HEADER) AC_SUBST(CLUTTER_STAGE_TYPE) -clutterbackendlib=libclutter-$clutterbackend-$CLUTTER_API_VERSION.la -AC_SUBST([clutterbackendlib]) +CLUTTER_WINSYS_LIB=libclutter-$CLUTTER_WINSYS-$CLUTTER_API_VERSION.la +AC_SUBST([CLUTTER_WINSYS_LIB]) + +dnl === Clutter substitutions kept for backwards compatibility ================ +CLUTTER_FLAVOUR=$CLUTTER_WINSYS +AC_SUBST([CLUTTER_FLAVOUR]) +CLUTTER_COGL=$COGL_DRIVER +AC_SUBST([CLUTTER_COGL]) + +dnl === Cogl substitutions ==================================================== +AC_SUBST([COGL_IMAGE_BACKEND]) +COGL_WINSYS=$CLUTTER_WINSYS +AC_SUBST([COGL_WINSYS]) +AC_SUBST([COGL_DRIVER]) dnl === Image loading backend ================================================= IMAGE_PC_FILES="" -# Peek which flavour the user wants so that we can couple the osx flavour with +# Peek which winsys the user wants so that we can couple the osx winsys with # quartz imageloader. -AS_IF([test "x$with_flavour" = "xosx"], [imagebackend=quartz], [imagebackend=gdk-pixbuf]) +AS_IF([test "x$COGL_WINSYS" = "xosx"], [COGL_IMAGE_BACKEND=quartz], [COGL_IMAGE_BACKEND=gdk-pixbuf]) -AC_ARG_WITH([imagebackend], +AC_ARG_WITH([COGL_IMAGE_BACKEND], [AC_HELP_STRING([--with-imagebackend=@<:@gdk-pixbuf/quartz/internal@:>@], [Select COGL image loading backend])], - [imagebackend=$with_imagebackend]) + [COGL_IMAGE_BACKEND=$with_imagebackend]) -AS_CASE([$imagebackend], +AS_CASE([$COGL_IMAGE_BACKEND], [quartz], [ @@ -426,7 +433,7 @@ dnl === X11 checks, only for X11-based backends =============================== X11_PC_FILES="" x11_tests=no -AS_IF([test "x$clutterbackend" = "xglx" || test "x$clutterbackend" = "xeglx"], +AS_IF([test "x$CLUTTER_WINSYS" = "xglx" || test "x$CLUTTER_WINSYS" = "xeglx"], [ # base X11 includes and libraries AC_MSG_CHECKING([for X11]) @@ -805,13 +812,15 @@ AC_CONFIG_FILES([ clutter/win32/clutter-win32.pc clutter/sdl/Makefile clutter/cogl/Makefile - clutter/cogl/common/Makefile - clutter/cogl/cogl.h - clutter/cogl/cogl-defines-gl.h:clutter/cogl/gl/cogl-defines.h.in - clutter/cogl/cogl-defines-gles.h:clutter/cogl/gles/cogl-defines.h.in - clutter/cogl/cogl.pc - clutter/cogl/gl/Makefile - clutter/cogl/gles/Makefile + clutter/cogl/cogl/Makefile + clutter/cogl/cogl/cogl.h + clutter/cogl/cogl/cogl-defines-gl.h:clutter/cogl/cogl/driver/gl/cogl-defines.h.in + clutter/cogl/cogl/cogl-defines-gles.h:clutter/cogl/cogl/driver/gles/cogl-defines.h.in + clutter/cogl/cogl/cogl.pc + clutter/cogl/cogl/winsys/Makefile + clutter/cogl/cogl/driver/Makefile + clutter/cogl/cogl/driver/gl/Makefile + clutter/cogl/cogl/driver/gles/Makefile clutter/json/Makefile clutter/pango/Makefile tests/Makefile @@ -842,13 +851,13 @@ echo " ====================" echo "" echo " prefix: ${prefix}" echo "" -echo " Flavour: ${clutterbackend}/${CLUTTER_COGL}" -if test "x$clutterbackend" = "xeglx" || test "x$clutterbackend" = "xglx"; then +echo " Flavour: ${CLUTTER_WINSYS}/${COGL_DRIVER}" +if test "x$CLUTTER_WINSYS" = "xeglx" || test "x$CLUTTER_WINSYS" = "xglx"; then echo " XInput: ${xinput}" fi echo " GL headers: ${CLUTTER_GL_HEADER}" -echo " Image backend: ${imagebackend}" -echo " Target library: ${clutterbackendlib}" +echo " Image backend: ${COGL_IMAGE_BACKEND}" +echo " Target library: ${CLUTTER_WINSYS_LIB}" echo " Clutter debug level: ${enable_debug}" echo " COGL debug level: ${enable_cogl_debug}" echo " Compiler flags: ${CPPFLAGS} ${MAINTAINER_CFLAGS}" @@ -861,11 +870,11 @@ echo "" # the experimental/unstable warning summary. if test "x$experimental_backend" = "xyes"; then - experimental_stuff="$experimental_stuff Clutter backend: ${clutterbackend}\n" + experimental_stuff="$experimental_stuff Clutter backend: ${CLUTTER_WINSYS}\n" fi if test "x$experimental_image" = "xyes"; then - experimental_stuff="$experimental_stuff Image backend: ${imagebackend}\n" + experimental_stuff="$experimental_stuff Image backend: ${COGL_IMAGE_BACKEND}\n" fi if test "x$experimental_stuff" != "x"; then diff --git a/doc/reference/clutter/Makefile.am b/doc/reference/clutter/Makefile.am index 829232984..4ee491a4f 100644 --- a/doc/reference/clutter/Makefile.am +++ b/doc/reference/clutter/Makefile.am @@ -24,7 +24,7 @@ DOC_SOURCE_DIR=../../../clutter SCANGOBJ_OPTIONS=--type-init-func="clutter_base_init()" # Extra options to supply to gtkdoc-scan. -# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" +# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" SCAN_OPTIONS=--deprecated-guards="CLUTTER_DISABLE_DEPRECATED" # Extra options to supply to gtkdoc-mkdb. @@ -142,8 +142,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 diff --git a/doc/reference/cogl/Makefile.am b/doc/reference/cogl/Makefile.am index e031b341c..89389e3d7 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 diff --git a/tests/conform/Makefile.am b/tests/conform/Makefile.am index 164bc9036..7a5b6f971 100644 --- a/tests/conform/Makefile.am +++ b/tests/conform/Makefile.am @@ -70,12 +70,14 @@ BUILT_SOURCES = wrappers test_conformance_CFLAGS = \ -I$(top_srcdir)/ \ -I$(top_srcdir)/clutter \ + -I$(top_srcdir)/clutter/cogl \ -I$(top_builddir)/clutter \ + -I$(top_builddir)/clutter/cogl \ -DG_DISABLE_SINGLE_INCLUDES \ $(CLUTTER_CFLAGS) \ $(MAINTAINER_CFLAGS) -test_conformance_LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@.la +test_conformance_LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la .PHONY: test .PHONY: test-report test-report-normal test-report-disable-npots diff --git a/tests/interactive/Makefile.am b/tests/interactive/Makefile.am index 9187b1e5d..ae8c3e7d9 100644 --- a/tests/interactive/Makefile.am +++ b/tests/interactive/Makefile.am @@ -75,10 +75,12 @@ BUILT_SOURCES = wrappers redhand.png redhand_alpha.png light0.png test-script.js INCLUDES = \ -I$(top_srcdir) \ -I$(top_srcdir)/clutter \ + -I$(top_srcdir)/clutter/cogl \ -I$(top_builddir)/clutter \ + -I$(top_builddir)/clutter/cogl \ -DG_DISABLE_SINGLE_INCLUDES -common_ldadd = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@.la +common_ldadd = $(top_builddir)/clutter/libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la noinst_PROGRAMS = test-interactive diff --git a/tests/micro-bench/Makefile.am b/tests/micro-bench/Makefile.am index 180b92cd7..05ef4973e 100644 --- a/tests/micro-bench/Makefile.am +++ b/tests/micro-bench/Makefile.am @@ -5,8 +5,13 @@ noinst_PROGRAMS = \ test-picking \ test-text-perf -INCLUDES = -I$(top_srcdir)/ -I$(top_srcdir)/clutter -I$(top_builddir)/clutter -LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_FLAVOUR@-@CLUTTER_API_VERSION@.la +INCLUDES = \ + -I$(top_srcdir)/ \ + -I$(top_srcdir)/clutter \ + -I$(top_srcdir)/clutter/cogl \ + -I$(top_builddir)/clutter \ + -I$(top_builddir)/clutter/cogl +LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la AM_CFLAGS = \ $(CLUTTER_CFLAGS) \ $(MAINTAINER_CFLAGS) \ diff --git a/tests/tools/Makefile.am b/tests/tools/Makefile.am index 535a7f587..658ee679f 100644 --- a/tests/tools/Makefile.am +++ b/tests/tools/Makefile.am @@ -18,7 +18,9 @@ libdisable_npots_static_la_LIBADD = -ldl INCLUDES = \ -I$(top_srcdir)/clutter \ + -I$(top_srcdir)/clutter/cogl \ -I$(top_builddir)/clutter \ + -I$(top_builddir)/clutter/cogl \ $(CLUTTER_CFLAGS) \ -D_GNU_SOURCE