Reactive Callbacks and integrate them

This commit is contained in:
Jaby
2024-06-13 22:07:37 +02:00
committed by Jaby
parent bdcd49f1c3
commit 4df3368eaa
9 changed files with 110 additions and 50 deletions

View File

@@ -0,0 +1,32 @@
#pragma once
#include "syscalls.hpp"
namespace JabyEngine {
namespace Callback {
using Function = void (*)();
struct VSyncCallback {
static Function callback;
static void install(Function function) {
VSyncCallback::callback = function;
}
static void uninstall() {
VSyncCallback::install(nullptr);
}
};
struct DataReadyCallback {
static Function callback;
static void install(Function function) {
DataReadyCallback::callback = function;
}
static void uninstall() {
DataReadyCallback::install(nullptr);
}
};
}
}