#include <allegro.h>
#include <allegro_image.h>
#include <allegro_font.h>
#include <allegro_ttf.h>

int MAXIMAGES = 2; //only 2 images used in this test
int MAXFONTS = 1; //font used to draw the fps
int ScrW = 800; //display width
int ScrH = 640; //display height

int main (int argc, char *argv[])
{

ALLEGRO_DISPLAY *gamedisp;//display
ALLEGRO_BITMAP* images [MAXIMAGES];//array of images
ALLEGRO_FONT* fonts [MAXFONTS];//same but for fonts

al_init();
al_init_image_addon();

ALLEGRO_PATH *path = al_get_standard_path(ALLEGRO_RESOURCES_PATH);
al_set_path_filename(path,"/bin/images/title.png");
images[0]=al_load_bitmap(al_path_cstr(path,'/'));
al_set_path_filename(path,"/bin/images/byval.png");
images[1]=al_load_bitmap(al_path_cstr(path,'/'));

gamedisp=al_create_display(ScrW,ScrH);

al_init_font_addon();
al_init_ttf_addon();
al_set_path_filename(path,"/bin/fonts/font.ttf");
fonts[0]=al_load_font(al_path_cstr(path,'/'),14,0);

float fps=0; //fps is 0 before any frames are rendered
double fpstime = al_get_time(); // used to compare frame times and give FPS

    while (1)
    {
	al_clear_to_color(al_map_rgb(0,0,0));
    al_draw_bitmap(images[0],259,248,0); //draws image 1 so its centered
	al_draw_bitmap(images[1],(ScrW/2),(ScrH/2)+30,0); //draws image 2 so it fits with image 1
	al_draw_textf(fonts[0],al_map_rgb(255,255,255),0,0,0,"FPS: %f",fps);//print fps
    al_flip_display();//flip

    double new_time = al_get_time();
    fps = 1.0f/(new_time-fpstime);
    fpstime = new_time;//new fps
    }



return 0;
}
