Establish VSyncCallback rendering
This commit is contained in:
@@ -14,6 +14,11 @@
|
||||
|
||||
namespace JabyEngine {
|
||||
namespace GPU {
|
||||
namespace internal {
|
||||
void render(const uint32_t* data, size_t words);
|
||||
void render_dma(const uint32_t* data);
|
||||
}
|
||||
|
||||
struct Display {
|
||||
#ifdef JABYENGINE_PAL
|
||||
static constexpr size_t Width = 320;
|
||||
@@ -42,6 +47,7 @@ namespace JabyEngine {
|
||||
|
||||
static void set_offset(int16_t x, int16_t y);
|
||||
};
|
||||
using VSyncCallback = void (*)();
|
||||
|
||||
static uint32_t update_id() {
|
||||
return Display::current_id;
|
||||
@@ -51,10 +57,7 @@ namespace JabyEngine {
|
||||
return Display::current_id ^ 1;
|
||||
}
|
||||
|
||||
namespace internal {
|
||||
void render(const uint32_t* data, size_t words);
|
||||
void render_dma(const uint32_t* data);
|
||||
}
|
||||
void set_vsync_callback(VSyncCallback callback);
|
||||
|
||||
template<typename T>
|
||||
static void render(const LinkedElement<T>& linked_primitives) {
|
||||
@@ -75,6 +78,7 @@ namespace JabyEngine {
|
||||
while(!GPU_IO::GPUSTAT.read().is_set(GPU_IO_Values::GPUSTAT::GP0ReadyForCMD));
|
||||
}
|
||||
|
||||
void swap_buffers(bool clear_screen = true);
|
||||
uint8_t swap_buffers_vsync(uint8_t syncs, bool clear_screen = true);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user