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.
 
 
 
 
 
 

53 lines
1.0 KiB

  1. #ifndef IZ_VIDEO_H
  2. #define IZ_VIDEO_H
  3. #include <stdio.h>
  4. #include "minIni.h"
  5. #include "SDL_render.h"
  6. #include "../../../net/IZ_net_client.h"
  7. #include "../../../config/IZ_config.h"
  8. #include "../../input/IZ_input.h"
  9. #include "../../../common/IZ_common.h"
  10. #define MAX_ACTIVE_SPRITES 32
  11. // TODO properly define sprites
  12. typedef char IZ_Sprite;
  13. typedef struct {
  14. u16 width;
  15. u16 height;
  16. u8 max_fps;
  17. } IZ_VideoConfig;
  18. typedef struct {
  19. void* user_data;
  20. IZ_VideoConfig config;
  21. u64 last_update_at;
  22. SDL_Window* window;
  23. SDL_Renderer* renderer;
  24. IZ_Sprite active_sprites[MAX_ACTIVE_SPRITES];
  25. } IZ_VideoState;
  26. static const IZ_VideoState IZ_VIDEO_DEFAULT_STATE = {
  27. .user_data = NULL,
  28. .config = {
  29. .width = 320u,
  30. .height = 240u,
  31. .max_fps = 30u,
  32. },
  33. .last_update_at = 0,
  34. .renderer = NULL,
  35. .window = NULL,
  36. .active_sprites = {},
  37. };
  38. IZ_ProcedureResult IZ_VideoInitialize(IZ_VideoState*, void*, const char*, u8, const char*[]);
  39. IZ_ProcedureResult IZ_VideoSaveConfig(IZ_VideoState*, const char*);
  40. void IZ_VideoTeardown(IZ_VideoState*);
  41. #endif