Prepare Font double buffer

This commit is contained in:
Jaby Blubb
2023-11-25 17:23:49 +01:00
parent 62dc080a22
commit 57798eec9f
4 changed files with 39 additions and 4 deletions

View File

@@ -1,10 +1,27 @@
#pragma once
#include <PSX/File/file_types.hpp>
#include <PSX/GPU/gpu_primitives.hpp>
#include <PSX/GPU/gpu_types.hpp>
namespace JabyEngine {
using FontPrimitive = GPU::SPRT::Linked;
struct FontInfo {
GPU::SizeU16 VRAMSize;
GPU::SizeU16 FontSize;
};
struct FontBufferInfo {
FontPrimitive* double_buffer[2];
size_t single_buffer_length;
static constexpr FontBufferInfo empty() {
return FontBufferInfo{.double_buffer = {nullptr, nullptr}, .single_buffer_length = 0};
}
template<size_t N>
static constexpr FontBufferInfo from(FontPrimitive (&buffer)[2][N]) {
return FontBufferInfo{.double_buffer = {buffer[0], buffer[1]}, .single_buffer_length = N};
}
};
}

View File

@@ -3,6 +3,6 @@
namespace JabyEngine {
struct FontWriter {
static void setup(SimpleTIM vram_dst, const FontInfo& font_info);
static void setup(const FontBufferInfo& buffer_info, SimpleTIM vram_dst, const FontInfo& font_info);
};
}