Reputation:
In Allegro, I can set the Window to be resizeable by running
al_set_new_display_flags(ALLEGRO_RESIZABLE);
before
display = al_create_display(800, 600);
however, if I resize the window, how will I know how big the window is that I resize?
Upvotes: 0
Views: 1182
Reputation: 7218
If you want to respond dynamically as the window is resized, you should listen for ALLEGRO_EVENT_DISPLAY_RESIZE
. Note that you'll have to register your display as a source for your event queue first:
al_register_event_source(event_queue, al_get_display_event_source(display));
Upvotes: 2
Reputation: 217
use al_get_window_constraints(ALLEGRO_DISPLAY *display,
int *min_w, int *min_h, int *max_w, int *max_h)
.
Upvotes: 1