Support simple sentances

This commit is contained in:
Jaby
2023-06-21 22:36:31 +02:00
committed by Jaby
parent bb895a0ddc
commit daf610cd00
3 changed files with 102 additions and 13 deletions

View File

@@ -1,25 +1,23 @@
#include "FontWriter/font_writer.hpp"
#include "assets.hpp"
#include <PSX/GPU/gpu_primitives.hpp>
#include <PSX/GPU/gpu.hpp>
#include <stdio.h>
using namespace JabyEngine;
static auto FontPage = GPU::TexPage({Assets::FontTIM.get_texture_x(), Assets::FontTIM.get_texture_y()}, GPU::TexturePageColor::$4bit).linked();
static auto FontTest = GPU::SPRT(
GPU::AreaI16({0, 0}, {256, 96}), {GPU::PagePosition(0, 0), GPU::PageClut(Assets::FontTIM.get_clut_x(), Assets::FontTIM.get_clut_y())},
GPU::Color24::Grey()
).linked();
static auto FontTestColor = GPU::SPRT(
GPU::AreaI16({0, 96}, {256, 96}), {GPU::PagePosition(0, 0), GPU::PageClut(Assets::FontTIM.get_clut_x(), Assets::FontTIM.get_clut_y())},
GPU::Color24(0x0, 0x0, 0xA0)
).linked();
static void setup() {
Assets::load_for_main();
FontWriter::setup();
}
void main() {
Assets::load_for_main();
FontPage.concat(FontTest).concat(FontTestColor);
setup();
while(true) {
FontWriter::write(0, 32, "Cody is cute\n&\na BAAAAABY!!!");
GPU::swap_buffers_vsync(1);
GPU::render(FontPage);
FontWriter::render();
}
}