Changed callbacks to std::function
Now you can also use lambdas with captured values.
This commit is contained in:
parent
502664615a
commit
f1e82f6126
@ -12,10 +12,11 @@
|
||||
#include <SDL2/SDL.h>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
namespace sc {
|
||||
namespace gui {
|
||||
using EventHandler = bool(*)(const SDL_Event&);
|
||||
using EventHandler = std::function<bool(const SDL_Event&)>;
|
||||
using RunLoopAction = void(*)();
|
||||
|
||||
class Application {
|
||||
|
@ -15,10 +15,11 @@
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <functional>
|
||||
|
||||
namespace sc {
|
||||
namespace gui {
|
||||
using WindowEventHandler = bool(*)(const SDL_Event&, bool quit);
|
||||
using WindowEventHandler = std::function<bool(const SDL_Event&, bool quit)>;
|
||||
class Image;
|
||||
|
||||
class Window {
|
||||
|
Loading…
x
Reference in New Issue
Block a user