how do I return true here?
I wanted to make it so I can do..
Can you not
why? its easy to read
bool window_is_running_var = true; bool window_is_running() { if (!window_initalized) return false; ALLEGRO_EVENT event; al_wait_for_event(window_queue, &event); if((event.type == ALLEGRO_EVENT_KEY_DOWN) || (event.type == ALLEGRO_EVENT_DISPLAY_CLOSE)) window_is_running_var = false; return window_is_running_var; }
?
al_wait_for_event blocks until it gets an event. If you don't want to do that, use one of its cousins, al_get_next_event or al_wait_for_event_until.
You could also run your window in a thread and send an event to your main loop when the window closes. The window is running until you get the close event.