Changed callbacks to std::function
Now you can also use lambdas with captured values.
This commit is contained in:
		@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user