Menu

#174 Bug with al_resize_display()

closed
nobody
None
5
2012-10-09
2009-02-26
Bruno Adami
No

I'm trying the new allegro library (4.9.8) and when I resize my display from 320x240 to 800x600, my sprites that I draw on the screen get bigger too:

http://img120.imageshack.us/img120/5203/large.jpg (The sprite shown on the image should be 150x40.)

I posted it on allegro.cc forums and they said that perhaps is my video card or my OS: I'm using Windows Vista and NVidia GeForce.

I tried it with the code that is attached.

Discussion

  • Bruno Adami

    Bruno Adami - 2009-02-26

    Code with the display issue

     
  • Bruno Adami

    Bruno Adami - 2009-02-26

    Bugged display

     
  • Bruno Adami

    Bruno Adami - 2009-02-26

    Update: I uploaded the image too.

     
  • Peter Wang

    Peter Wang - 2009-03-12

    Works okay on Linux, so probably Windows or D3D specific.

     
  • Trent Gamblin

    Trent Gamblin - 2009-03-15

    This is a code error in your test program. This is how it should be done:

    include <allegro5 allegro5.h=""></allegro5>

    include <allegro5 a5_iio.h=""></allegro5>

    int main(void)
    {
    ALLEGRO_DISPLAY display;
    ALLEGRO_BITMAP
    bitmap;
    ALLEGRO_EVENT_QUEUE *queue;
    ALLEGRO_EVENT event;

    al_init();
    al_iio_init();
    
    display = al_create_display(320, 240);
    bitmap = al_iio_load("allegro.pcx");
    
    queue = al_create_event_queue();
    al_register_event_source(queue, (ALLEGRO_EVENT_SOURCE *)display);
    
    al_clear(al_map_rgb(0, 0, 0));
    al_draw_bitmap(bitmap, 0, 0, 0);
    al_flip_display();
    al_rest(3);
    
    al_resize_display(800, 600);
    
    while (1) {
        al_wait_for_event(queue, &event);
        if (event.type == ALLEGRO_EVENT_DISPLAY_RESIZE) {
            al_acknowledge_resize(event.display.source);
            break;
        }
    }
    
    al_clear(al_map_rgb(0, 0, 0));
    al_draw_bitmap(bitmap, 0, 0, 0);
    al_flip_display();
    al_rest(3);
    
    return 0;
    

    }
    END_OF_MAIN()

     

Log in to post a comment.