Próbuję narysować tablice(15x15) box'ów(30*30px), ale rysuje mi tylko ostatnie pudełko, a tak to mam czarny ekran. Co robię źle?
while(1)
{
ALLEGRO_EVENT ev;
al_wait_for_event(event_queue, &ev);
if(ev.type == ALLEGRO_EVENT_TIMER) {
redraw = true;
}
else if(ev.type == ALLEGRO_EVENT_DISPLAY_CLOSE)
break;
if(redraw && al_is_event_queue_empty(event_queue))
{
redraw = false;
al_clear_to_color(al_map_rgb(0,0,0));
for(int i=0; i<225; i++)
{
int row = (int) i / 15;
box_y = 30 * row + 8;
box_x = (i % 15) * 30 + 8;
al_draw_bitmap(box[i], box_x, box_y, 0);
}
al_flip_display();
}
}
dodanie znacznika <code class="cpp"> - fp