summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cogl/Makefile.am6
-rw-r--r--cogl/cogl-clutter.c59
-rw-r--r--cogl/cogl-clutter.h47
-rw-r--r--cogl/cogl-framebuffer-private.h4
-rw-r--r--cogl/cogl-framebuffer.c9
-rw-r--r--cogl/cogl-private.h3
-rw-r--r--cogl/cogl.h3
7 files changed, 120 insertions, 11 deletions
diff --git a/cogl/Makefile.am b/cogl/Makefile.am
index 9f6a837d..a4d67cfe 100644
--- a/cogl/Makefile.am
+++ b/cogl/Makefile.am
@@ -78,6 +78,7 @@ cogl_public_h = \
$(srcdir)/cogl-attribute.h \
$(srcdir)/cogl-primitive.h \
$(srcdir)/cogl-clip-state.h \
+ $(srcdir)/cogl-clutter.h \
$(srcdir)/cogl.h \
$(NULL)
@@ -271,8 +272,9 @@ cogl_sources_c = \
$(srcdir)/cogl-shader-private.h \
$(srcdir)/cogl-shader.c \
$(srcdir)/cogl-gtype-private.h \
- $(srcdir)/cogl-point-in-poly-private.h \
- $(srcdir)/cogl-point-in-poly.c \
+ $(srcdir)/cogl-point-in-poly-private.h \
+ $(srcdir)/cogl-point-in-poly.c \
+ $(srcdir)/cogl-clutter.c \
$(NULL)
if SUPPORT_XLIB
diff --git a/cogl/cogl-clutter.c b/cogl/cogl-clutter.c
new file mode 100644
index 00000000..07f827af
--- /dev/null
+++ b/cogl/cogl-clutter.c
@@ -0,0 +1,59 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Authors:
+ * Robert Bragg <robert@linux.intel.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <glib.h>
+
+#include "cogl.h"
+#include "cogl-types.h"
+#include "cogl-private.h"
+#include "cogl-context-private.h"
+#include "cogl-winsys-private.h"
+#include "cogl-framebuffer-private.h"
+
+gboolean
+cogl_clutter_check_extension (const char *name, const char *ext)
+{
+ return _cogl_check_extension (name, ext);
+}
+
+void
+cogl_onscreen_clutter_backend_set_size (int width, int height)
+{
+ CoglFramebuffer *framebuffer;
+
+ _COGL_GET_CONTEXT (ctx, NO_RETVAL);
+
+ if (!ctx->stub_winsys)
+ return;
+
+ framebuffer = COGL_FRAMEBUFFER (ctx->window_buffer);
+
+ _cogl_framebuffer_winsys_update_size (framebuffer, width, height);
+}
diff --git a/cogl/cogl-clutter.h b/cogl/cogl-clutter.h
new file mode 100644
index 00000000..023d14fd
--- /dev/null
+++ b/cogl/cogl-clutter.h
@@ -0,0 +1,47 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2011 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#if !defined(__COGL_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
+#error "Only <cogl/cogl.h> can be included directly."
+#endif
+
+#ifndef __COGL_CLUTTER_H__
+#define __COGL_CLUTTER_H__
+
+#ifdef COGL_HAS_XLIB
+#include <X11/Xutil.h>
+#endif
+
+G_BEGIN_DECLS
+
+#define cogl_clutter_check_extension cogl_clutter_check_extension_CLUTTER
+gboolean
+cogl_clutter_check_extension (const char *name, const char *ext);
+
+#define cogl_onscreen_clutter_backend_set_size cogl_onscreen_clutter_backend_set_size_CLUTTER
+void
+cogl_onscreen_clutter_backend_set_size (int width, int height);
+
+G_END_DECLS
+
+#endif /* __COGL_CLUTTER_H__ */
diff --git a/cogl/cogl-framebuffer-private.h b/cogl/cogl-framebuffer-private.h
index fc956647..afc8fe19 100644
--- a/cogl/cogl-framebuffer-private.h
+++ b/cogl/cogl-framebuffer-private.h
@@ -114,6 +114,10 @@ void
_cogl_framebuffer_state_init (void);
void
+_cogl_framebuffer_winsys_update_size (CoglFramebuffer *framebuffer,
+ int width, int height);
+
+void
_cogl_clear4f (unsigned long buffers,
float red,
float green,
diff --git a/cogl/cogl-framebuffer.c b/cogl/cogl-framebuffer.c
index 8a9feff5..a1459942 100644
--- a/cogl/cogl-framebuffer.c
+++ b/cogl/cogl-framebuffer.c
@@ -989,13 +989,10 @@ _cogl_onscreen_free (CoglOnscreen *onscreen)
}
void
-_cogl_onscreen_clutter_backend_set_size (int width, int height)
+_cogl_framebuffer_winsys_update_size (CoglFramebuffer *framebuffer,
+ int width, int height)
{
- CoglFramebuffer *framebuffer;
-
- _COGL_GET_CONTEXT (ctx, NO_RETVAL);
-
- framebuffer = COGL_FRAMEBUFFER (ctx->window_buffer);
+ CoglContext *ctx = framebuffer->context;
if (framebuffer->width == width && framebuffer->height == height)
return;
diff --git a/cogl/cogl-private.h b/cogl/cogl-private.h
index afcfe469..4407b421 100644
--- a/cogl/cogl-private.h
+++ b/cogl/cogl-private.h
@@ -26,6 +26,9 @@
G_BEGIN_DECLS
+gboolean
+_cogl_check_extension (const char *name, const char *ext);
+
void
_cogl_clear (const CoglColor *color, unsigned long buffers);
diff --git a/cogl/cogl.h b/cogl/cogl.h
index 28f2f3d5..fffc12c6 100644
--- a/cogl/cogl.h
+++ b/cogl/cogl.h
@@ -1277,9 +1277,6 @@ _cogl_check_driver_valid (GError **error);
GQuark
_cogl_driver_error_quark (void);
-void
-_cogl_onscreen_clutter_backend_set_size (int width, int height);
-
#ifdef COGL_ENABLE_EXPERIMENTAL_API
#define cogl_get_draw_framebuffer cogl_get_draw_framebuffer_EXP
CoglFramebuffer *