From 23e3edda061c433d29d3a544e6fee8e11cd5a221 Mon Sep 17 00:00:00 2001 From: Fierelier Date: Sat, 20 Jul 2024 19:39:02 +0200 Subject: [PATCH] Use blit for example --- test/graphics.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/graphics.c b/test/graphics.c index 97cda67..0133cc0 100644 --- a/test/graphics.c +++ b/test/graphics.c @@ -15,6 +15,7 @@ int main(int argc, char *argv[]) { res.width = 640; res.height = 480; res.depth = 32; + unigi_type_color pixels[res.width * res.height]; unigi_type_resolution_2d_coord x; unigi_type_resolution_2d_coord y; unigi_type_resolution_1d_coord max = res.width * res.height; @@ -28,13 +29,16 @@ int main(int argc, char *argv[]) { exit(0); } + for (y = 0; y < res.height; y++) { for (x = 0; x < res.width; x++) { //unigi_graphics_draw((y * res.width) + x,(t + (x ^ y)) + y); - unigi_graphics_draw((((y * res.width) + x) + t) % max,(t + (x ^ y)) + y); + //unigi_graphics_draw((((y * res.width) + x) + t) % max,(t + (x ^ y)) + y); + pixels[(((y * res.width) + x) + t) % max] = (t + (x ^ y)) + y; } t2++; } + unigi_graphics_blit(0,&pixels,res.width * res.height); unigi_graphics_flush(); t++; }