=== modified file 'crate.c'
--- old/crate.c	2010-09-09 13:55:23 +0000
+++ new/crate.c	2010-09-09 15:13:20 +0000
@@ -1,3 +1,4 @@
+#include <GL/gl.h>
 #include <clutter/clutter.h>
 #include <cogl/cogl-pango.h>
 
@@ -256,10 +257,15 @@
   cogl_set_source (data->crate_material);
 
   /* Give Cogl some geometry to draw. */
+
+  /* Cogl doesn't currently support vertex buffers with rectangle textures
+
   cogl_vertex_buffer_draw (data->vbo,
                            COGL_VERTICES_MODE_TRIANGLES,
                            0,
                            G_N_ELEMENTS (vertices));
+  */
+  cogl_rectangle(-1.0, 1.0, 1.0, -1.0);
 
   cogl_set_depth_test_enabled (FALSE);
 
@@ -425,10 +431,31 @@
                           &vertices[0].tx);
 
   /* Load a jpeg crate texture from a file */
-  data.texture = cogl_texture_new_from_file ("crate1.jpg",
-                                             COGL_TEXTURE_NO_SLICING,
-                                             COGL_PIXEL_FORMAT_ANY,
-                                             NULL);
+  if (cogl_features_available(COGL_FEATURE_TEXTURE_RECTANGLE)) {
+    g_message("Rectangle texture support is available, using it...");
+    data.texture = cogl_texture_rectangle_new_from_file ("crate1.jpg",
+                                               COGL_TEXTURE_NO_SLICING,
+                                               COGL_PIXEL_FORMAT_ANY,
+                                               NULL);
+  }
+  else {
+    g_message("Rectangle texture support is *not* available, using TEXTURE_2D");
+    data.texture = cogl_texture_new_from_file ("crate1.jpg",
+                                               COGL_TEXTURE_NO_SLICING,
+                                               COGL_PIXEL_FORMAT_ANY,
+                                               NULL);
+  }
+
+  {
+    /* Just to make sure we really get a rectangle texture */
+    GLint tex;
+    GLenum target;
+    cogl_texture_get_gl_texture(data.texture, &tex, &target);
+    g_message("Gltex: %u Target: 0x%X (%s)", tex, target,
+              target == 0x84F5 ? "TEXTURE_RECTANGLE" :
+                target == 0x0DE1 ? "TEXTURE_2D" : "unknown");
+  }
+
 
   /* a CoglMaterial conceptually describes all the state for vertex
    * processing, fragment processing and blending geometry. When

