added test event handler for window close

This commit is contained in:
Bob Polis 2020-10-24 23:15:45 +02:00
parent 5a7e2a0547
commit 65574004a1

View File

@ -69,6 +69,10 @@ int main(int argc, const char * argv[]) {
// main window
sc::gui::Window& window {sc::gui::Window::new_window("screensaver")};
window.add_event_handler([](const SDL_Event& event, bool quit) -> bool {
std::cerr << "closing window " << event.window.windowID << '\n';
return quit;
}, SDL_WINDOWEVENT_CLOSE);
int opt_char, opt_val;
struct option long_options[] = {