-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.d
62 lines (47 loc) · 1.37 KB
/
main.d
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
pragma(lib, "dallegro5");
pragma(lib, "allegro");
pragma(lib, "allegro_primitives");
pragma(lib, "allegro_image");
pragma(lib, "allegro_font");
//pragma(lib, "allegro_ttf");
pragma(lib, "allegro_color");
// D imports
import std.stdio : writeln;
// allegro imports
import allegro5.allegro;
import allegro5.allegro_primitives;
import allegro5.allegro_image;
import allegro5.allegro_font;
//import allegro5.allegro_ttf;
import allegro5.allegro_color;
// app imports
import globals;
import game;
// app allegro global variables
ALLEGRO_DISPLAY* display;
ALLEGRO_EVENT_QUEUE* queue;
ALLEGRO_FONT* messageFont;
ALLEGRO_BITMAP* imgTileSet, imgPlayer, imgMob;
int main()
{
return al_run_allegro(
{
// set up allegro
al_init();
display = al_create_display(1024, 768);
queue = al_create_event_queue();
al_install_keyboard();
al_install_mouse();
al_init_image_addon();
al_init_font_addon();
//al_init_ttf_addon();
al_init_primitives_addon();
al_register_event_source(queue, al_get_display_event_source(display));
al_register_event_source(queue, al_get_keyboard_event_source());
al_register_event_source(queue, al_get_mouse_event_source());
al_set_window_title(display, "Renascent");
debug writeln("... allegro initialised");
mainMenu();
return 0;
});
}