offscreen: cogl_offscreen_new_to_texture now supports GL_TEXTURE_RECTANGLE_ARB
authorRobert Bragg <robert@linux.intel.com>
Wed, 25 Nov 2009 02:47:52 +0000 (02:47 +0000)
committerRobert Bragg <robert@linux.intel.com>
Wed, 25 Nov 2009 02:56:25 +0000 (02:56 +0000)
cogl_offscreen_new_to_texture previously bailed out if the given texture's
GL target was anything but GL_TEXTURE_2D, but it now also allows
foreign GL_TEXTURE_RECTANGLE_ARB textures.

Thanks to Owen for reporting this issue, ref:
https://bugzilla.gnome.org/show_bug.cgi?id=601032

clutter/cogl/cogl/cogl-draw-buffer.c

index 2a7b757..d32d325 100644 (file)
@@ -265,7 +265,8 @@ cogl_offscreen_new_to_texture (CoglHandle texhandle)
   if (!cogl_texture_get_gl_texture (texhandle, &tex_gl_handle, &tex_gl_target))
     return COGL_INVALID_HANDLE;
 
-  if (tex_gl_target != GL_TEXTURE_2D)
+  if (tex_gl_target != GL_TEXTURE_2D &&
+      tex_gl_target != GL_TEXTURE_RECTANGLE_ARB)
     return COGL_INVALID_HANDLE;
 
   /* Create a renderbuffer for stenciling */