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 <SDL2/SDL.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
namespace sc {
|
namespace sc {
|
||||||
namespace gui {
|
namespace gui {
|
||||||
using EventHandler = bool(*)(const SDL_Event&);
|
using EventHandler = std::function<bool(const SDL_Event&)>;
|
||||||
using RunLoopAction = void(*)();
|
using RunLoopAction = void(*)();
|
||||||
|
|
||||||
class Application {
|
class Application {
|
||||||
|
@ -15,10 +15,11 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
namespace sc {
|
namespace sc {
|
||||||
namespace gui {
|
namespace gui {
|
||||||
using WindowEventHandler = bool(*)(const SDL_Event&, bool quit);
|
using WindowEventHandler = std::function<bool(const SDL_Event&, bool quit)>;
|
||||||
class Image;
|
class Image;
|
||||||
|
|
||||||
class Window {
|
class Window {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user