blob: 3399d043cea86e216cba1f1f32f21a993a1f5cea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#include "cfg.hpp"
#include "lzr.h"
#include "input.h"
#include "Table.hpp"
#include "Cursor.hpp"
#include "Menu.hpp"
#include <string.h>
int main(int argc, char **argv)
{
(void)argc, (void)argv;
if (LZR_Init(cfg))
{
LZR_Quit();
return 1;
}
LZR_ToggleFullscreen();
char snd_path[] = "res/sample_x.wav";
char *snd_x = strchr(snd_path, 'x');
for (int i = 0; i < 3; i++) {
*snd_x = '0' + i;
if (LZR_SoundLoad(snd_path, 1.0f) < 0) {
LZR_Quit();
return 1;
}
}
Cursor cursor;
Table table;
Menu menu;
while (!LZR_ShouldQuit()) {
LZR_CycleEvents();
input_update();
cursor.update();
table.update(cursor);
menu.update(cursor);
table.set_layer(menu.get_selection());
LZR_DrawBegin();
LZR_DrawSetColor(0, 0, 0, 1);
LZR_DrawClear();
table.draw(cursor);
menu.draw();
cursor.draw();
LZR_DrawEnd();
}
LZR_Quit();
return 0;
}
|