[cogl/cogl-1.16] examples: avoid using the auto-texture apis



commit 5580baeffb3d811a7519cfdd1baf685d24d4303a
Author: Robert Bragg <robert linux intel com>
Date:   Sun Jun 9 01:44:29 2013 +0100

    examples: avoid using the auto-texture apis
    
    Instead of using cogl_texture_new_from_file/with_size in the example we
    now use the cogl_texture_2d_ equivalents. This is in preparation for
    removing the cogl-auto-texture apis.
    
    Reviewed-by: Neil Roberts <neil linux intel com>
    
    (cherry picked from commit 815a1c80db4132fff6ccf97fc08396e61fc31ebb)
    
    Conflicts:
        examples/cogl-crate.c
        examples/cogl-gles2-context.c
        examples/cogl-msaa.c

 examples/cogl-crate.c         |    9 +++++----
 examples/cogl-gles2-context.c |   10 +++++-----
 examples/cogl-msaa.c          |    6 +++---
 3 files changed, 13 insertions(+), 12 deletions(-)
---
diff --git a/examples/cogl-crate.c b/examples/cogl-crate.c
index cdd6a7c..f3a412f 100644
--- a/examples/cogl-crate.c
+++ b/examples/cogl-crate.c
@@ -220,10 +220,11 @@ main (int argc, char **argv)
 
   /* Load a jpeg crate texture from a file */
   printf ("crate.jpg (CC by-nc-nd http://bit.ly/9kP45T) ShadowRunner27 http://bit.ly/m1YXLh\n";);
-  data.texture = cogl_texture_new_from_file (COGL_EXAMPLES_DATA "crate.jpg",
-                                             COGL_TEXTURE_NO_SLICING,
-                                             COGL_PIXEL_FORMAT_ANY,
-                                             &error);
+  data.texture = COGL_TEXTURE (
+    cogl_texture_2d_new_from_file (ctx,
+                                   COGL_EXAMPLES_DATA "crate.jpg",
+                                   COGL_PIXEL_FORMAT_ANY,
+                                   &error));
   if (!data.texture)
     g_error ("Failed to load texture: %s", error->message);
 
diff --git a/examples/cogl-gles2-context.c b/examples/cogl-gles2-context.c
index de66c21..8093851 100644
--- a/examples/cogl-gles2-context.c
+++ b/examples/cogl-gles2-context.c
@@ -95,11 +95,11 @@ main (int argc, char **argv)
                                              3, triangle_vertices);
     data.pipeline = cogl_pipeline_new (data.ctx);
 
-    data.offscreen_texture =
-      cogl_texture_new_with_size (OFFSCREEN_WIDTH,
-                                  OFFSCREEN_HEIGHT,
-                                  COGL_TEXTURE_NO_SLICING,
-                                  COGL_PIXEL_FORMAT_ANY);
+    data.offscreen_texture = COGL_TEXTURE (
+      cogl_texture_2d_new_with_size (data.ctx,
+                                     OFFSCREEN_WIDTH,
+                                     OFFSCREEN_HEIGHT,
+                                     COGL_PIXEL_FORMAT_ANY));
     data.offscreen = cogl_offscreen_new_to_texture (data.offscreen_texture);
 
     data.gles2_ctx = cogl_gles2_context_new (data.ctx, &error);
diff --git a/examples/cogl-msaa.c b/examples/cogl-msaa.c
index 49e395e..ea5ce8f 100644
--- a/examples/cogl-msaa.c
+++ b/examples/cogl-msaa.c
@@ -62,9 +62,9 @@ main (int argc, char **argv)
 
     cogl_onscreen_show (onscreen);
 
-    tex = cogl_texture_new_with_size (320, 480,
-                                      COGL_TEXTURE_NO_SLICING,
-                                      COGL_PIXEL_FORMAT_ANY);
+    tex = COGL_TEXTURE (cogl_texture_2d_new_with_size (ctx,
+                                                       320, 480,
+                                                       COGL_PIXEL_FORMAT_ANY));
     offscreen = cogl_offscreen_new_to_texture (tex);
     offscreen_fb = COGL_FRAMEBUFFER (offscreen);
     cogl_framebuffer_set_samples_per_pixel (offscreen_fb, 4);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]