Support VSync callback

This commit is contained in:
2024-05-15 21:43:12 +02:00
parent 3c0cc3bb6a
commit deb5bf8442
11 changed files with 156 additions and 49 deletions

View File

@@ -7,6 +7,7 @@
#include <FontWriter/font_writer.hpp>
#include <PSX/Audio/CDDA.hpp>
#include <PSX/Periphery/periphery.hpp>
#include <PSX/System/callbacks.hpp>
#include <stdio.hpp>
using namespace JabyEngine;
@@ -155,6 +156,10 @@ namespace LoadingScene {
static void run() {
if(old_state_changer != state_changer) {
printf("Loading new state...\n");
Callback::VSyncCallback::install([]() {
printf("Still loading...\n");
});
update();
GPU::swap_buffers_vsync(1);
@@ -165,6 +170,7 @@ namespace LoadingScene {
state_changer.asset_load();
old_state_changer = state_changer;
CDDA::pop_play();
Callback::VSyncCallback::uninstall();
}
state_changer.main();