Support VSync callback
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user