I'm stuck creating a window that fits my map. Allegro 4.2 shows just 70% of my map; I've tried changing the size of the windows but it stops working at my map size, and I've also tried FULLSCREEN
in set_gfx_mode
. This is the code that I'm using:
BITMAP* buffer;
BITMAP* rock;
char map[30][30] {-- -the map-- -};
void draw_map() {
int row, col;
for(row = 0; row < 30; row++) {
for(col = 0; col < 30; col++) {
if(mapa[row][col] == 'X') {
draw_sprite(buffer, rock, col * 30, row * 30) ;
}
}
}
}
void onscreen() {
blit(buffer, screen, 0, 0, 0, 0, 640, 480);
}
int main() {
//allegro default code
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 640, 480, 0, 0);
buffer = create_bitmap(640, 480);
rock = load_bitmap("rock.bmp", NULL);
while(!key[KEY_ESC]) {
draw_map();
onscreen();
}
}