From 6e37cebc7a5ca8aab51d866bca9916c0b5483728 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Fri, 9 Dec 2011 17:13:17 +0000 Subject: [PATCH] renderer: Make COGL_RENDERER / COGL_DRIVER env. variables case insensitive This will make it much more user friendly :-) Reviewed-by: Neil Roberts --- cogl/cogl-renderer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cogl/cogl-renderer.c b/cogl/cogl-renderer.c index aed8dc943..4157ac43e 100644 --- a/cogl/cogl-renderer.c +++ b/cogl/cogl-renderer.c @@ -222,7 +222,7 @@ _cogl_renderer_choose_driver (CoglRenderer *renderer, driver_name = _cogl_config_driver; #ifdef HAVE_COGL_GL - if (driver_name == NULL || !strcmp (driver_name, "gl")) + if (driver_name == NULL || !g_ascii_strcasecmp (driver_name, "gl")) { renderer->driver = COGL_DRIVER_GL; libgl_name = COGL_GL_LIBNAME; @@ -231,7 +231,7 @@ _cogl_renderer_choose_driver (CoglRenderer *renderer, #endif #ifdef HAVE_COGL_GLES2 - if (driver_name == NULL || !strcmp (driver_name, "gles2")) + if (driver_name == NULL || !g_ascii_strcasecmp (driver_name, "gles2")) { renderer->driver = COGL_DRIVER_GLES2; libgl_name = COGL_GLES2_LIBNAME; @@ -240,7 +240,7 @@ _cogl_renderer_choose_driver (CoglRenderer *renderer, #endif #ifdef HAVE_COGL_GLES - if (driver_name == NULL || !strcmp (driver_name, "gles1")) + if (driver_name == NULL || !g_ascii_strcasecmp (driver_name, "gles1")) { renderer->driver = COGL_DRIVER_GLES1; libgl_name = COGL_GLES1_LIBNAME; @@ -308,7 +308,8 @@ cogl_renderer_connect (CoglRenderer *renderer, GError **error) char *user_choice = getenv ("COGL_RENDERER"); if (!user_choice) user_choice = _cogl_config_renderer; - if (user_choice && strcmp (winsys->name, user_choice) != 0) + if (user_choice && + g_ascii_strcasecmp (winsys->name, user_choice) != 0) continue; }