You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.1 KiB
C++
49 lines
1.1 KiB
C++
6 years ago
|
#include <stdio.h>
|
||
|
#include <allegro5/allegro.h>
|
||
|
#include <allegro5/allegro_image.h>
|
||
|
#include <allegro5/allegro_audio.h>
|
||
|
#include <allegro5/allegro_acodec.h>
|
||
|
#include <allegro5/allegro_color.h>
|
||
|
#include <allegro5/allegro_font.h>
|
||
|
|
||
|
#include "game.h"
|
||
|
|
||
|
int main() {
|
||
6 years ago
|
//Initialize components and addons
|
||
6 years ago
|
if (!al_init()) {
|
||
|
fprintf(stderr, "Could not initialize Allegro!");
|
||
|
}
|
||
|
if (!al_init_image_addon()) {
|
||
|
fprintf(stderr, "Could not initialize image addon!");
|
||
|
}
|
||
|
if (!al_init_acodec_addon()) {
|
||
|
fprintf(stderr, "Could not initialize audio codec addon!");
|
||
|
}
|
||
|
if (!al_install_audio()) {
|
||
|
fprintf(stderr, "Could not install audio!");
|
||
|
}
|
||
|
if (!al_init_font_addon()) {
|
||
|
fprintf(stderr, "Could not initialize font addon!");
|
||
|
}
|
||
|
if (!al_install_keyboard()) {
|
||
|
fprintf(stderr, "Could not install keyboard!");
|
||
|
}
|
||
6 years ago
|
if (!al_init_primitives_addon()) {
|
||
|
fprintf(stderr, "Could not initialize primitives addon!");
|
||
|
}
|
||
6 years ago
|
|
||
6 years ago
|
//Create display
|
||
6 years ago
|
ALLEGRO_DISPLAY* display = NULL;
|
||
|
display = al_create_display(SCREEN_W, SCREEN_H);
|
||
|
|
||
6 years ago
|
//Run game
|
||
6 years ago
|
Game main_game;
|
||
|
main_game.init();
|
||
|
main_game.run();
|
||
|
|
||
6 years ago
|
//Garbage collection
|
||
6 years ago
|
al_uninstall_keyboard();
|
||
|
al_uninstall_audio();
|
||
|
|
||
|
return 0;
|
||
|
}
|