2D Run-and-gun shooter inspired by One Man's Doomsday, Counter-Strike, and Metal Slug.
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.
 
 
 
 
 
 

46 lines
886 B

  1. #ifndef IZ_VIDEO_H
  2. #define IZ_VIDEO_H
  3. #include <stdio.h>
  4. #include <minIni.h>
  5. #include <SDL_render.h>
  6. // TODO move this out from video, refer to app's state instead
  7. #include "../input/IZ_input.h"
  8. #include "../IZ_common.h"
  9. #include "../IZ_config.h"
  10. typedef struct {
  11. u16 width;
  12. u16 height;
  13. u8 max_fps;
  14. } IZ_VideoConfig;
  15. typedef struct {
  16. IZ_VideoConfig config;
  17. uint64_t last_update_at;
  18. SDL_Window* window;
  19. SDL_Renderer* renderer;
  20. } IZ_VideoState;
  21. static const IZ_VideoState IZ_DEFAULT_VIDEO_STATE = {
  22. .config = {
  23. .width = 320u,
  24. .height = 240u,
  25. .max_fps = 30u,
  26. },
  27. .last_update_at = 0,
  28. .renderer = NULL,
  29. .window = NULL,
  30. };
  31. IZ_ProcedureResult IZ_VideoInitialize(const char*, IZ_VideoState*);
  32. IZ_ProcedureResult IZ_VideoSaveConfig(const char*, IZ_VideoConfig*);
  33. void IZ_VideoUpdate(IZ_VideoState*, IZ_InputState*, u64);
  34. void IZ_VideoTeardown(IZ_VideoState*);
  35. #endif