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
|
#include <allegro.h>
int main()
{
/* Initialization */
allegro_init();
install_keyboard();
install_timer();
install_mouse();
install_sound( DIGI_AUTODETECT, MIDI_AUTODETECT, 0 );
set_color_depth( 16 );
bool fullscreen = false;
if ( fullscreen == true ) // For fullscreen
set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
else // For windowed
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
BITMAP *buffer = create_bitmap( 640, 480 );
/* End Initialization */
/* Game loop and such would go here */
while ( !key[KEY_ESC] )
{
rectfill( buffer, 0, 0,
640, 480
makecol(255, 0, 0 ) );
/* Draw functions */
blit( buffer, screen, 0, 0, 0, 0, 640, 480 );
clear_bitmap( buffer );
}
/* Free memory afterwards! */
destroy_bitmap( buffer );
return 0;
}
END_OF_MAIN();
|