8cef16017e
boost.signals sadly requires way too many dependencies, libsigc++ requires too much configuration and all the other libs I tested mostly required constexpr as callbacks (due to passing callbacks via template list), which doesn't server this purpose, so wink-signals seems just about right for what we do.
25 lines
434 B
C++
25 lines
434 B
C++
namespace Components
|
|
{
|
|
class Renderer : public Component
|
|
{
|
|
public:
|
|
typedef void(Callback)();
|
|
|
|
Renderer();
|
|
~Renderer();
|
|
const char* GetName() { return "Renderer"; };
|
|
|
|
static int Width();
|
|
static int Height();
|
|
|
|
static void OnFrame(Callback* callback);
|
|
|
|
private:
|
|
static void FrameHook();
|
|
static void FrameHandler();
|
|
|
|
static wink::signal<wink::slot<Callback>> FrameSignal;
|
|
static Utils::Hook DrawFrameHook;
|
|
};
|
|
}
|