nuclear@0: #ifndef OPT_H_ nuclear@0: #define OPT_H_ nuclear@0: nuclear@19: enum opt_type { OTYPE_INT, OTYPE_FLOAT, OTYPE_VEC }; nuclear@0: nuclear@0: struct option { nuclear@0: enum opt_type type; nuclear@0: int ival; nuclear@0: float fval; nuclear@19: float vval[4]; nuclear@0: }; nuclear@0: nuclear@0: void *create_options(void); nuclear@0: void destroy_options(void *optdb); nuclear@0: nuclear@0: void set_option_int(void *optdb, const char *key, int val); nuclear@0: void set_option_float(void *optdb, const char *key, float val); nuclear@19: void set_option_vec(void *optdb, const char *key, float *val); nuclear@19: /* convenience functions */ nuclear@19: void set_option_vec3f(void *optdb, const char *key, float x, float y, float z); nuclear@19: void set_option_vec4f(void *optdb, const char *key, float x, float y, float z, float w); nuclear@0: nuclear@0: int get_option_int(void *optdb, const char *key, int *val); nuclear@0: int get_option_float(void *optdb, const char *key, float *val); nuclear@19: int get_option_vec(void *optdb, const char *key, float *val); nuclear@0: nuclear@0: #endif /* OPT_H_ */