aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-02-14 06:26:42 +0100
committerkdx <kikoodx@paranoici.org>2023-02-14 06:31:54 +0100
commit409148cc3d427c1e331ed2e71111cb6375ee637e (patch)
treec4cec8b85e01be0591e8e71c84ae744a9412a8c7 /main.c
parent2f8bb3ede40c167542690dec7e198df925ad06ae (diff)
downloadtzr-409148cc3d427c1e331ed2e71111cb6375ee637e.tar.gz
draw image
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/main.c b/main.c
index ccb7988..d30d87f 100644
--- a/main.c
+++ b/main.c
@@ -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;