From 5481681e5c74a8eb994935e5a14d08cc4372a791 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Wed, 6 May 2009 23:35:01 -0400 Subject: [PATCH] Use the right internal format for GL_ARB_texture_rectangle When ClutterGLXTexturePixmap uses GL_ARB_texture_rectangle, it needs to pass the right internal format (GL_RGB or GL_RGBA) when it initializes the texture with glTexImage2D() or later handling won't recognize the alpha channel. http://bugzilla.openedhand.com/show_bug.cgi?id=1586 Signed-off-by: Robert Bragg --- clutter/glx/clutter-glx-texture-pixmap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clutter/glx/clutter-glx-texture-pixmap.c b/clutter/glx/clutter-glx-texture-pixmap.c index c2f5aadcc..c1a02206e 100644 --- a/clutter/glx/clutter-glx-texture-pixmap.c +++ b/clutter/glx/clutter-glx-texture-pixmap.c @@ -331,7 +331,10 @@ create_cogl_texture (ClutterTexture *texture, cogl_format = COGL_PIXEL_FORMAT_RGB_888; } else - g_critical ("Can't create a TFP cogl texture for pixmap with depth < 24"); + { + g_critical ("Can't create a TFP cogl texture for pixmap with depth < 24"); + return FALSE; + } /* We want to use the GL_ARB_texture_rectangle extension on some chipsets because GL_ARB_texture_non_power_of_two is not always @@ -345,7 +348,7 @@ create_cogl_texture (ClutterTexture *texture, glGenTextures (1, &tex); glBindTexture (CGL_TEXTURE_RECTANGLE_ARB, tex); glTexImage2D (CGL_TEXTURE_RECTANGLE_ARB, 0, - GL_RGB, width, height, + gl_format, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); handle = cogl_texture_new_from_foreign (tex, CGL_TEXTURE_RECTANGLE_ARB,