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/
	<put common source here>
	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.
This commit is contained in:
Robert Bragg 2009-07-28 02:02:02 +01:00
parent 2eea83de75
commit 43efab46bc
118 changed files with 834 additions and 431 deletions

View File

@ -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-<major>.<minor>.pc - for generic dependencies
clutter-$(CLUTTER_API_VERSION).pc: clutter.pc
$(QUIET_GEN)cp $< $@
# clutter-<flavour>-<major>.<minor>.pc - for backend-specific dependencies
clutter-$(CLUTTER_FLAVOUR)-$(CLUTTER_API_VERSION).pc: clutter.pc
# clutter-<winsys>-<major>.<minor>.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 \

View File

@ -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}

View File

@ -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
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 \

View File

@ -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

View File

@ -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

View File

@ -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}

View File

@ -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

View File

@ -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;

View File

@ -37,8 +37,8 @@ struct _floatVec2
struct _CoglPathNode
{
GLfloat x;
GLfloat y;
float x;
float y;
guint path_size;
};

View File

@ -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)
{

View File

@ -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>

View File

@ -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}

View File

@ -0,0 +1,7 @@
include $(top_srcdir)/build/autotools/Makefile.am.silent
NULL =
SUBDIRS = $(COGL_DRIVER)
DIST_SUBDIRS = gl gles

View File

@ -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

View File

@ -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)
{

View File

@ -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 $< > $@

View File

@ -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)

View File

@ -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)

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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 */

Some files were not shown because too many files have changed in this diff Show More