From f1e82f61269cfc3c1e563aaffe348bd71a3de6d8 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Mon, 1 Feb 2021 00:38:55 +0100 Subject: [PATCH] Changed callbacks to std::function Now you can also use lambdas with captured values. --- src/Application.hpp | 3 ++- src/Window.hpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Application.hpp b/src/Application.hpp index d84972d..ad510ba 100644 --- a/src/Application.hpp +++ b/src/Application.hpp @@ -12,10 +12,11 @@ #include #include #include +#include namespace sc { namespace gui { - using EventHandler = bool(*)(const SDL_Event&); + using EventHandler = std::function; using RunLoopAction = void(*)(); class Application { diff --git a/src/Window.hpp b/src/Window.hpp index a2dec84..2ac8b59 100644 --- a/src/Window.hpp +++ b/src/Window.hpp @@ -15,10 +15,11 @@ #include #include #include +#include namespace sc { namespace gui { - using WindowEventHandler = bool(*)(const SDL_Event&, bool quit); + using WindowEventHandler = std::function; class Image; class Window {