Mercurial > molko
comparison examples/example-sprite/main.c @ 325:cd8b87ddd1e7
examples: bring back to live using CMake
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 02 Oct 2021 17:47:27 +0200 |
parents | eaab6bd635ab |
children | 570ab19bf268 |
comparison
equal
deleted
inserted
replaced
324:87ad3de308b6 | 325:cd8b87ddd1e7 |
---|---|
37 #include <ui/label.h> | 37 #include <ui/label.h> |
38 #include <ui/ui.h> | 38 #include <ui/ui.h> |
39 | 39 |
40 #define W 1280 | 40 #define W 1280 |
41 #define H 720 | 41 #define H 720 |
42 #define PATH(r) util_pathf("%s/mlk-adventure/%s", sys_dir(SYS_DIR_DATA), r) | 42 #define PATH(r) util_pathf("%s/%s", sys_dir(SYS_DIR_DATA), r) |
43 #define HEADER "Keys: <Left>/<Right> and <Up/Down> to select a column/row. Current: %u, %u (total %u/%u)" | 43 #define HEADER "Keys: <Left>/<Right> and <Up/Down> to select a column/row. Current: %u, %u (total %u/%u)" |
44 | 44 |
45 static char msg[512]; | 45 static char msg[512]; |
46 static struct texture texture; | 46 static struct texture texture; |
47 static struct sprite sprite; | 47 static struct sprite sprite; |
61 } | 61 } |
62 | 62 |
63 static void | 63 static void |
64 init(void) | 64 init(void) |
65 { | 65 { |
66 if (core_init("fr.malikania", "sprite") < 0 || ui_init() < 0) | 66 if (core_init("fr.malikania", "mlk-adventure") < 0 || ui_init() < 0) |
67 panic(); | 67 panic(); |
68 if (window_open("Example - Sprite", W, H) < 0) | 68 if (window_open("Example - Sprite", W, H) < 0) |
69 panic(); | 69 panic(); |
70 if (image_open(&texture, PATH("sprites/people.png")) < 0) | 70 if (image_open(&texture, PATH("sprites/people.png")) < 0) |
71 panic(); | 71 panic(); |