added test event handler for window close
This commit is contained in:
parent
5a7e2a0547
commit
65574004a1
4
main.cpp
4
main.cpp
@ -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[] = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user