i am using allegro 5.0.10 , and i am trying to create a sub display , a normal display that my classes treats as a sub window of a parent one , the problem is all drawing operation made on that child window are not visible until i move it (shake it , move it 2 times go and back) . i am wondering , what are the correct flags and options i need to use to let the sub window draws correctly
All you should need to do is set the current display and then flip it.
ALLEGRO_DISPLAY* d1 = al_create_display(400,300); ALLEGRO_DISPLAY* d2 = al_create_display(200,150); al_set_target_backbuffer(d1); al_clear_to_color(al_map_rgb(255,0,0)); al_flip_display(); al_set_target_backbuffer(d2); al_clear_to_color(al_map_rgb(0,255,0)); al_flip_display(); al_rest(5.0);
You'll note that al_flip_display() doesn't take any parameters, like a display. This means it is operating on globally stored data, in this case, the currently active display. al_set_target_backbuffer(display); will change the currently active display.
thanks the problem is solved , it is not about allegro it self it is my using al_store_state(&state,ALLEGRO_TARGET_BITMAP) with no need