summaryrefslogtreecommitdiff
path: root/cogl/cogl.c
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2011-08-03 18:15:54 +0100
committerRobert Bragg <robert@linux.intel.com>2011-08-12 15:28:42 +0100
commit2ac4002084864e2530ce7908efb00a8697e85d07 (patch)
tree9b669ac24a8d11c114fb1e887042b971ae8bed5a /cogl/cogl.c
parent5012bcf1d1fb09a0bece1e3d417ed7c4e3d6cd0c (diff)
downloadcogl-2ac4002084864e2530ce7908efb00a8697e85d07.tar.gz
cogl: Add support for reading a cogl.conf config file
When cogl initializes we now check for a cogl/cogl.conf in any of the system config dirs (determined using $XDG_CONFIG_DIRS on linux) we then also check the user's config directory (determined using XDG_CONFIG_HOME on linux) for a cogl/cogl.conf file. Options specified in the user config file have priority over the system config options. The config file has an .ini style syntax with a mandatory [global] section and we currently understand 3 keynames: COGL_DEBUG, COGL_DRIVER and COGL_RENDERER which have the same semantics as the corresponding environment variables. Options set using the environment variables have priority over options set in the config files. To allow users to undo the enabling of debug options in config files this patch also adds a check for COGL_NO_DEBUG environment variable which will disable the specified options which may have been enabled in config files. Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'cogl/cogl.c')
-rw-r--r--cogl/cogl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cogl/cogl.c b/cogl/cogl.c
index e9621c2f..10c2cd84 100644
--- a/cogl/cogl.c
+++ b/cogl/cogl.c
@@ -47,6 +47,7 @@
#include "cogl-attribute-private.h"
#include "cogl-framebuffer-private.h"
#include "cogl-renderer-private.h"
+#include "cogl-config-private.h"
#ifndef GL_PACK_INVERT_MESA
#define GL_PACK_INVERT_MESA 0x8758
@@ -1122,6 +1123,7 @@ _cogl_init (void)
{
g_type_init ();
+ _cogl_config_read ();
_cogl_debug_check_environment ();
g_once_init_leave (&init_status, 1);
}