Starter project for SDL2.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
715 B

  1. #include "IZ_video.h"
  2. IZ_ProcedureResult IZ_SaveVideoConfig(IZ_VideoConfig* config) {
  3. char config_path[128];
  4. IZ_GetConfigPath(config_path, 128);
  5. if (!ini_putl("Video", "Width", config->width, config_path)) {
  6. return 1;
  7. }
  8. if (!ini_putl("Video", "Height", config->height, config_path)) {
  9. return 1;
  10. }
  11. if (!ini_putl("Video", "MaxFps", config->max_fps, config_path)) {
  12. return 1;
  13. }
  14. return 0;
  15. }
  16. void IZ_LoadVideoConfig(IZ_VideoConfig* config) {
  17. char config_path[128];
  18. IZ_GetConfigPath(config_path, 128);
  19. config->width = ini_getl("Video", "Width", 640l, config_path);
  20. config->height = ini_getl("Video", "Height", 480l, config_path);
  21. config->max_fps = ini_getl("Video", "MaxFps", 30, config_path);
  22. }