Implement buffered font loader

This commit is contained in:
2023-12-17 23:10:36 +01:00
parent f222b1d28a
commit d6cbf7b12e
2 changed files with 91 additions and 36 deletions

View File

@@ -1,18 +1,32 @@
#pragma once
#include "../../System/IOPorts/gpu_io.hpp"
#include "linked_elements.hpp"
#include "primitive_support_types.hpp"
namespace JabyEngine {
namespace GPU {
struct TexPage : public internal::LinkedElementCreator<TexPage> {
static constexpr bool is_render_primitive = true;
struct GPU_IO::GP0 value;
static constexpr TexPage create(const PositionU16& tex_pos, TexturePageColor tex_color, SemiTransparency transparency = SemiTransparency::B_Half_add_F_Half, bool dither = false) {
return TexPage{.value = GPU_IO::Command::TexPage(tex_pos, transparency, tex_color, dither, false)};
}
};
}
#pragma once
#include "../../System/IOPorts/gpu_io.hpp"
#include "linked_elements.hpp"
#include "primitive_support_types.hpp"
namespace JabyEngine {
namespace GPU {
struct TexPage : public internal::LinkedElementCreator<TexPage> {
static constexpr bool is_render_primitive = true;
struct GPU_IO::GP0 value;
static constexpr TexPage create(const PositionU16& tex_pos, TexturePageColor tex_color, SemiTransparency transparency = SemiTransparency::B_Half_add_F_Half, bool dither = false) {
return TexPage{.value = GPU_IO::Command::TexPage(tex_pos, transparency, tex_color, dither, false)};
}
};
struct CPU2VRAM {
struct GPU_IO::GP0 cmd;
struct GPU_IO::GP0 pos;
struct GPU_IO::GP0 size;
static constexpr CPU2VRAM create(const AreaU16& dst) {
return CPU2VRAM{
.cmd = GPU_IO::Command::CPU2VRAM_Blitting(),
.pos = GPU_IO::Command::TopLeftPosition(dst.position),
.size = GPU_IO::Command::WidthHeight(dst.size)
};
}
};
}
}