Use blit for example

This commit is contained in:
Fierelier 2024-07-20 19:39:02 +02:00
parent 08edc234f9
commit 23e3edda06

View File

@ -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++;
}