|
- #ifndef IZ_VIDEO_H
- #define IZ_VIDEO_H
-
- #include <stdio.h>
- #include <minIni.h>
- #include <SDL_render.h>
-
- // TODO move this out from video, refer to app's state instead
- #include "../input/IZ_input.h"
- #include "../IZ_common.h"
- #include "../IZ_config.h"
-
- typedef struct {
- u16 width;
- u16 height;
- u8 max_fps;
- } IZ_VideoConfig;
-
- typedef struct {
- IZ_VideoConfig config;
- uint64_t last_update_at;
- SDL_Window* window;
- SDL_Renderer* renderer;
- } IZ_VideoState;
-
- static const IZ_VideoState IZ_DEFAULT_VIDEO_STATE = {
- .config = {
- .width = 320u,
- .height = 240u,
- .max_fps = 30u,
- },
- .last_update_at = 0,
- .renderer = NULL,
- .window = NULL,
- };
-
- IZ_ProcedureResult IZ_VideoInitialize(const char*, IZ_VideoState*);
-
- IZ_ProcedureResult IZ_VideoSaveConfig(const char*, IZ_VideoConfig*);
-
- void IZ_VideoUpdate(IZ_VideoState*, IZ_InputState*, u64);
-
- void IZ_VideoTeardown(IZ_VideoState*);
-
- #endif
|