Change to object orientated design

This commit is contained in:
2023-11-30 20:55:36 -05:00
parent c7e43a0210
commit 90731c1e52
3 changed files with 60 additions and 77 deletions

View File

@@ -14,12 +14,13 @@ using NewFontWriter = ::JabyEngine::FontWriter;
static object::Paco paco;
static FontPrimitive font_buffer[2][256];
static NewFontWriter new_font_writer;
static void setup() {
static constexpr auto FontTIM = SimpleTIM(320, 0, 320, DefaultFont::Info.VRAMSize.height);
DefaultFont::load(&__heap_start, FontTIM);
NewFontWriter::setup(FontBufferInfo::from(font_buffer), FontTIM, DefaultFont::Info);
new_font_writer.setup(FontBufferInfo::from(font_buffer), FontTIM, DefaultFont::Info);
Assets::load_for_main();
FontWriter::FontWriter::setup();
@@ -29,13 +30,11 @@ static void setup() {
static void update() {
FontWriter::FontWriter cursor;
auto new_cursor = NewFontWriter::start(Make::PositionI16(16, 16));
const auto end_pos = cursor.write(FontWriter::Position::create(0, 32), "Cody is cute\n&\na \x1b[8;0;0mBAAAAABY!!!");
cursor.write(end_pos, "\x1b[0;7;7mJaby was\nhere c:");
new_cursor.write("0");
new_font_writer.write(Make::PositionI16(8, 8), "012345");
paco.update();
}
@@ -43,7 +42,7 @@ static void render() {
GPU::swap_buffers_vsync(1);
FontWriter::FontWriter::render();
paco.render();
NewFontWriter::render();
new_font_writer.render();
}
void main() {