Improve LINE_F code

This commit is contained in:
2023-05-27 22:21:02 +02:00
parent f67361c62b
commit 3d0a5b81c2
5 changed files with 108 additions and 47 deletions

View File

@@ -87,9 +87,17 @@ static constexpr const auto rectangle5 = JabyEngine::GPU::POLY_GT4(
JabyEngine::GPU::Color24::White()}
).set_semi_transparent(true);
static constexpr const auto line1 = JabyEngine::GPU::LineMaker::new_line_f(LineColor, {
static constexpr const auto line1 = JabyEngine::GPU::LINE_F::create(LineColor, {
{0, 0},
{JabyEngine::GPU::Display::Width, JabyEngine::GPU::Display::Height}});
{JabyEngine::GPU::Display::Width, JabyEngine::GPU::Display::Height}
});
static constexpr const auto line2 = JabyEngine::GPU::LINE_F::create(LineColor.invert(),
JabyEngine::GPU::Vertex(0, 0),
JabyEngine::GPU::Vertex(16, 0),
JabyEngine::GPU::Vertex(16, 16),
JabyEngine::GPU::Vertex(0, 0)
);
static void load_assets() {
static const JabyEngine::CDFile Assets[] = {
@@ -122,7 +130,6 @@ static void load_assets() {
void main() {
load_assets();
printf("Dino: 0x%02X\n", rectangle4.code.value);
while(true) {
JabyEngine::GPU::render(triangle1);
@@ -137,6 +144,7 @@ void main() {
JabyEngine::GPU::render(rectangle5);
JabyEngine::GPU::render(line1);
JabyEngine::GPU::render(line2);
JabyEngine::GPU::swap_buffers_vsync(2);
}