diff options
author | Benji Dial <benji@benjidial.net> | 2024-05-18 21:53:38 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-05-18 21:53:38 -0400 |
commit | b1a912a8a6ff472a49b2e0a09cfd433adfc2cb24 (patch) | |
tree | 5009d4415ba13e4baa37f3d0271852528130fd3b /applications/init/source/main.cpp | |
parent | a8a80d326de9550b2a25b1255a2093ab43219ede (diff) | |
download | hilbert-os-b1a912a8a6ff472a49b2e0a09cfd433adfc2cb24.tar.gz |
reorganization, cross compiler
Diffstat (limited to 'applications/init/source/main.cpp')
-rw-r--r-- | applications/init/source/main.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/applications/init/source/main.cpp b/applications/init/source/main.cpp new file mode 100644 index 0000000..ed0ef8e --- /dev/null +++ b/applications/init/source/main.cpp @@ -0,0 +1,28 @@ +#include <daguerre.hpp> + +int main(int, char **) { + + auto hfb = daguerre::get_hilbert_framebuffer(); + daguerre::image<daguerre::rgb24> bim; + + std::FILE *burdon = std::fopen("/assets/burden.ppm", "r"); + daguerre::try_load_ppm(burdon, bim); + std::fclose(burdon); + + unsigned width = bim.width < hfb.width ? bim.width : hfb.width; + unsigned height = bim.height < hfb.height ? bim.height : hfb.height; + unsigned x = (hfb.width - width) / 2; + unsigned y = (hfb.height - height) / 2; + + while (1) { + daguerre::copy_region<>(hfb, bim, 0, 0, x, y, width, height); + while ((__euler_read_key_packet() & 0x0400ff) != 0x00005a) + ; + for (unsigned i = 0; i < bim.width * bim.height; ++i) { + bim.buffer[i].r = 255 - bim.buffer[i].r; + bim.buffer[i].g = 255 - bim.buffer[i].g; + bim.buffer[i].b = 255 - bim.buffer[i].b; + } + } + +} |