[nostalgia] Add implementation of single tile sprites on OpenGL

This commit is contained in:
2023-01-03 03:37:51 -06:00
parent cf6c05f4c6
commit bb643bce42
11 changed files with 312 additions and 99 deletions
+7 -9
View File
@@ -32,15 +32,13 @@ ox::Error run(Context *ctx) noexcept {
while (!glfwWindowShouldClose(id->window)) {
glfwPollEvents();
const auto ticks = ticksMs(ctx);
if (id->eventHandler) {
if (id->wakeupTime <= ticks) {
sleepTime = id->eventHandler(ctx);
if (sleepTime >= 0) {
id->wakeupTime = ticks + static_cast<unsigned>(sleepTime);
} else {
id->wakeupTime = ~uint64_t(0);
}
}
if (id->wakeupTime <= ticks) {
sleepTime = id->eventHandler(ctx);
if (sleepTime >= 0) {
id->wakeupTime = ticks + static_cast<unsigned>(sleepTime);
} else {
id->wakeupTime = ~uint64_t(0);
}
} else {
sleepTime = 10;
}