don't force double buffering
[sdl_omap.git] / src / video / omapdss / config.c
index 52809d6..adedaef 100644 (file)
@@ -14,6 +14,7 @@
 #include "omapsdl.h"
 
 int gcfg_force_vsync;
+int gcfg_force_doublebuf;
 
 static char *sskip(char *p)
 {
@@ -65,7 +66,7 @@ void omapsdl_config(void)
                if (line == NULL)
                        break;
                p = line = sskip(line);
-               if (*p == '#')
+               if (*p == 0 || *p == '#')
                        continue;
 
                if (check_token(&p, "bind")) {
@@ -89,6 +90,10 @@ void omapsdl_config(void)
                        gcfg_force_vsync = strtol(p, NULL, 0);
                        continue;
                }
+               else if (check_token_eq(&p, "force_doublebuf")) {
+                       gcfg_force_doublebuf = strtol(p, NULL, 0);
+                       continue;
+               }
 
 bad:
                err("config: failed to parse: %s", line);
@@ -96,4 +101,15 @@ bad:
        fclose(f);
 }
 
+void omapsdl_config_from_env(void)
+{
+       const char *tmp;
+
+       tmp = getenv("SDL_OMAP_VSYNC");
+       if (tmp != NULL)
+               gcfg_force_vsync = strtol(tmp, NULL, 0);
+       tmp = getenv("SDL_OMAP_FORCE_DOUBLEBUF");
+       if (tmp != NULL)
+               gcfg_force_doublebuf = strtol(tmp, NULL, 0);
+}