#pragma once #include #include #include enum TZR_ResourceType { TZR_RES_RAW, TZR_RES_IMAGE, TZR_RES_SOUND, ___TZR_RES_COUNT }; enum TZR_EventType { TZR_EV_QUIT, TZR_EV_KEYDOWN, TZR_EV_KEYUP }; enum TZR_KeyState { TZR_KEYSTATE_UP, TZR_KEYSTATE_DOWN, TZR_KEYSTATE_RELEASE, TZR_KEYSTATE_PRESS }; enum TZR_MixerFlags { TZR_MIXER_OFF, TZR_MIXER_ON, TZR_MIXER_FLAC }; typedef unsigned int TZR_Uint; typedef struct TZR_Config TZR_Config; typedef struct TZR_Point TZR_Point; typedef struct TZR_Color TZR_Color; typedef struct TZR_Rect TZR_Rect; typedef enum TZR_ResourceType TZR_ResourceType; typedef struct TZR_Raw TZR_Raw; typedef struct TZR_Image TZR_Image; typedef struct TZR_Sound TZR_Sound; typedef struct TZR_Resource TZR_Resource; typedef enum TZR_EventType TZR_EventType; typedef struct TZR_Event TZR_Event; typedef struct TZR_Music TZR_Music; typedef struct TZR_DrawImageArgs TZR_DrawImageArgs; typedef struct TZR_DrawRectangleArgs TZR_DrawRectangleArgs; typedef struct TZR_PlaySoundArgs TZR_PlaySoundArgs; typedef enum TZR_KeyState TZR_KeyState; struct TZR_Config { int _; int width; int height; int scale; int target_fps; bool pixel_perfect; bool hd_render; bool scale_linear; bool show_cursor; unsigned int mixer; const char *title; }; struct TZR_Point { int x; int y; }; struct TZR_Color { int _; float r; float g; float b; float a; }; struct TZR_Rect { TZR_Point from; TZR_Point to; }; struct TZR_Raw { void *data; size_t size; }; struct TZR_Image { int width; int height; SDL_Texture *ptr; }; struct TZR_Sound { Mix_Chunk *ptr; }; struct TZR_Resource { TZR_ResourceType type; char *path; /* allocated and freed by TZR; can be NULL */ long mtime; union { TZR_Raw raw; /* raw file data */ TZR_Image image; TZR_Sound sound; }; }; struct TZR_Event { TZR_EventType type; int button; }; struct TZR_DrawImageArgs { int _; TZR_Uint id; int x; int y; int ix; int iy; int w; int h; float r; float sx; float sy; bool center; bool flip_x; bool flip_y; }; struct TZR_DrawRectangleArgs { int _; int x; int y; int w; int h; bool fill; bool center; }; struct TZR_PlaySoundArgs { int _; int id; int loop; float volume; };