Starter project for SDL2.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

28 lignes
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. }