Sign in to follow this  
vaneger

allegro issue

Recommended Posts


#include<allegro.h>

BITMAP* buffer;

int ticks  = 0;
const int FPS = 60;

void ticker()
{
     ticks++;
}
END_OF_FUNCTION(ticker);

int main()
{
	allegro_init();
	install_keyboard();
	set_color_depth(16);
	set_gfx_mode( GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
	
	buffer = create_bitmap(640, 480);
	
	int frames = ticks;
    install_int_ex(ticker, BPS_TO_TIMER(FPS));
	
	while( !key[KEY_ESC])
	{
		if (frames <= ticks)
    	        {
			clear_bitmap(buffer);
			blit(buffer, screen, 0, 0, 0, 0, 640, 480);
			frames++;
		}
	}

	destroy_bitmap(buffer);
	return 0;

}
END_OF_MAIN();


thats my current code for a bare bones allegro program, but it gives me some kind of link error. what can i do to fix this?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this