summaryrefslogtreecommitdiff
path: root/boilerplate/cairo-boilerplate-cogl.c
diff options
context:
space:
mode:
Diffstat (limited to 'boilerplate/cairo-boilerplate-cogl.c')
-rw-r--r--boilerplate/cairo-boilerplate-cogl.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/boilerplate/cairo-boilerplate-cogl.c b/boilerplate/cairo-boilerplate-cogl.c
index 8dda3172..a9b0c757 100644
--- a/boilerplate/cairo-boilerplate-cogl.c
+++ b/boilerplate/cairo-boilerplate-cogl.c
@@ -33,7 +33,7 @@
#include "cairo-boilerplate-private.h"
#include <cairo-cogl.h>
-#include <cogl/cogl2-experimental.h>
+#include <cogl/cogl.h>
typedef struct _cogl_closure {
cairo_device_t *device;
@@ -71,7 +71,7 @@ _cairo_boilerplate_cogl_create_offscreen_color_surface (const char *name,
{
cairo_device_t *device;
CoglTexture *tex;
- CoglHandle offscreen;
+ CoglOffscreen *offscreen;
CoglFramebuffer *fb;
cogl_closure_t *closure;
cairo_status_t status;
@@ -80,18 +80,20 @@ _cairo_boilerplate_cogl_create_offscreen_color_surface (const char *name,
context = cogl_context_new (NULL, NULL);
device = cairo_cogl_device_create (context);
- tex = cogl_texture_new_with_size (width, height,
+ tex = cogl_texture_new_with_size (context,
+ width, height,
COGL_TEXTURE_NO_SLICING,
- COGL_PIXEL_FORMAT_BGRA_8888_PRE);
+ COGL_PIXEL_FORMAT_BGRA_8888_PRE,
+ NULL);
offscreen = cogl_offscreen_new_to_texture (tex);
fb = COGL_FRAMEBUFFER (offscreen);
cogl_framebuffer_allocate (fb, NULL);
- cogl_push_framebuffer (fb);
- cogl_ortho (0, cogl_framebuffer_get_width (fb),
- cogl_framebuffer_get_height (fb), 0,
- -1, 100);
- cogl_pop_framebuffer ();
+ cogl_framebuffer_orthographic (fb,
+ 0, 0,
+ cogl_framebuffer_get_width (fb),
+ cogl_framebuffer_get_height (fb),
+ -1, 100);
closure = malloc (sizeof (cogl_closure_t));
*abstract_closure = closure;
@@ -134,11 +136,11 @@ _cairo_boilerplate_cogl_create_onscreen_color_surface (const char *name,
cogl_onscreen_show (onscreen);
- cogl_push_framebuffer (fb);
- cogl_ortho (0, cogl_framebuffer_get_width (fb),
- cogl_framebuffer_get_height (fb), 0,
- -1, 100);
- cogl_pop_framebuffer ();
+ cogl_framebuffer_orthographic (fb,
+ 0, 0,
+ cogl_framebuffer_get_width (fb),
+ cogl_framebuffer_get_height (fb),
+ -1, 100);
closure = malloc (sizeof (cogl_closure_t));
*abstract_closure = closure;
@@ -162,7 +164,7 @@ _cairo_boilerplate_cogl_finish_onscreen (cairo_surface_t *surface)
cairo_cogl_surface_end_frame (surface);
- cogl_framebuffer_swap_buffers (closure->fb);
+ cogl_onscreen_swap_buffers (COGL_ONSCREEN (closure->fb));
return CAIRO_STATUS_SUCCESS;
}