#include "omapsdl.h"
int gcfg_force_vsync;
+int gcfg_force_doublebuf;
static char *sskip(char *p)
{
if (line == NULL)
break;
p = line = sskip(line);
- if (*p == '#')
+ if (*p == 0 || *p == '#')
continue;
if (check_token(&p, "bind")) {
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);
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);
+}