From 12ea2933bd35d22b34973674abf6dcb43fca31f8 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 6 Jan 2009 18:24:57 +0000 Subject: [PATCH] [cogl-material] Restore the GL_TEXTURE_ENV_MODE after material_rectangle The rest of Cogl expects the texture mode to be GL_MODULATE so it needs to be restored after calling cogl_material_rectangle. Otherwise cogl_texture_rectangle will fail to blend with the Cogl color properly and all of the labels will be black. --- clutter/cogl/gl/cogl-texture.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clutter/cogl/gl/cogl-texture.c b/clutter/cogl/gl/cogl-texture.c index f80a54e52..2d6d54778 100644 --- a/clutter/cogl/gl/cogl-texture.c +++ b/clutter/cogl/gl/cogl-texture.c @@ -2595,6 +2595,10 @@ cogl_material_rectangle (CoglFixed x1, GE (glDisable (GL_TEXTURE_2D)); } + /* The rest of Cogl expects the texture mode to be GL_MODULATE so we + need to restore that */ + GE( glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE) ); + /* XXX: a bit over precautious. For one we don't support lighting yet * so there's no real need to reset the material properties. */ #if 0