diff options
author | kdx <kikoodx@paranoici.org> | 2023-02-14 06:26:42 +0100 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2023-02-14 06:31:54 +0100 |
commit | 409148cc3d427c1e331ed2e71111cb6375ee637e (patch) | |
tree | c4cec8b85e01be0591e8e71c84ae744a9412a8c7 /main.c | |
parent | 2f8bb3ede40c167542690dec7e198df925ad06ae (diff) | |
download | tzr-409148cc3d427c1e331ed2e71111cb6375ee637e.tar.gz |
draw image
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1,8 +1,11 @@ #include "headers/TZR.h" +#include <SDL2/SDL_main.h> int main(int argc, char **argv) { (void)argc, (void)argv; + + /* Initialization. */ TZR_Config cfg = { .width = 512, .height = 256, @@ -13,14 +16,21 @@ int main(int argc, char **argv) return 1; if (atexit(TZR_Quit)) return TZR_Quit(), 1; + + /* Load assets. */ const TZR_Uint id0 = TZR_LoadResourceTyped(TZR_RES_IMAGE, "res.bmp"); const TZR_Uint id1 = TZR_LoadResourceTyped(TZR_RES_RAW, "main.c"); if (id0 == 0 || id1 == 0) return 1; + + /* Print assets paths. */ printf("%s %s\n", TZR_GetResourcePath(id0), TZR_GetResourcePath(id1)); + + /* Main loop. */ while (!TZR_ShouldQuit()) { TZR_CycleEvents(); TZR_DrawBegin(); + TZR_DrawImage(id0, 0, 0); TZR_DrawEnd(); } return 0; |