Support LINE_F

This commit is contained in:
2023-05-27 15:14:19 +02:00
parent 6f735eeefb
commit 4914e3b9b4
5 changed files with 100 additions and 11 deletions

View File

@@ -22,6 +22,8 @@ static constexpr auto RectangleArea = JabyEngine::GPU::AreaI16({0, TriangleArea
static constexpr auto RectangleTPage = JabyEngine::GPU::TPage(320, 256, JabyEngine::GPU::SemiTransparency::B_Half_add_F_Half, JabyEngine::GPU::TexturePageColor::$4bit);
static constexpr auto RectangleClut = JabyEngine::GPU::PageClut(320, 510);
static constexpr auto LineColor = JabyEngine::GPU::Color24(0xFF, 0x0, 0x0);
static constexpr const auto triangle1 = JabyEngine::GPU::POLY_F3({
{TriangleArea.position.x, TriangleArea.position.y},
{TriangleArea.size.width, TriangleArea.size.height},
@@ -85,6 +87,12 @@ static constexpr const auto rectangle5 = JabyEngine::GPU::POLY_GT4(
JabyEngine::GPU::Color24::White()}
).set_semi_transparent(true);
static constexpr const JabyEngine::GPU::LINE_F line1[] = {
JabyEngine::GPU::LINE_F::new_line(LineColor, false),
JabyEngine::GPU::LINE_F::new_point({0, 0}),
JabyEngine::GPU::LINE_F::new_point({JabyEngine::GPU::Display::Width, JabyEngine::GPU::Display::Height})
};
static void load_assets() {
static const JabyEngine::CDFile Assets[] = {
JabyEngine::CDFileBuilder::simple_tim(LBA::FONT, JabyEngine::SimpleTIM(320, 0, 320, 511)),
@@ -130,6 +138,8 @@ void main() {
JabyEngine::GPU::render(rectangle4);
JabyEngine::GPU::render(rectangle5);
JabyEngine::GPU::render(line1);
JabyEngine::GPU::swap_buffers_vsync(2);
}
}