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/main.cpp | |
parent | a8a80d326de9550b2a25b1255a2093ab43219ede (diff) | |
download | hilbert-os-b1a912a8a6ff472a49b2e0a09cfd433adfc2cb24.tar.gz |
reorganization, cross compiler
Diffstat (limited to 'applications/init/main.cpp')
-rw-r--r-- | applications/init/main.cpp | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/applications/init/main.cpp b/applications/init/main.cpp deleted file mode 100644 index 57ebd02..0000000 --- a/applications/init/main.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include <daguerre/image.hpp> - -int main(int, char **) { - - auto fb = daguerre::get_hilbert_framebuffer(); - - auto white = daguerre::to_hilbert_color({.r = 255, .g = 255, .b = 255}); - auto gray = daguerre::to_hilbert_color({.r = 127, .g = 127, .b = 127}); - - for (unsigned y = 0; y < fb.get_height(); ++y) - for (unsigned x = 0; x < fb.get_width(); ++x) { - uint8_t v = (y / 16) % 2 == (x / 16) % 2; - fb.get(x, y) = v ? white : gray; - } - - daguerre::image<daguerre::color24> img; - - std::FILE *file = std::fopen("/init/burdon.ppm", "r"); - assert(file != 0); - assert(daguerre::try_load_ppm(file, img)); - std::fclose(file); - - unsigned width = - img.get_width() < fb.get_width() ? img.get_width() : fb.get_width(); - unsigned height = - img.get_height() < fb.get_height() ? img.get_height() : fb.get_height(); - - unsigned x_off = (fb.get_width() - width) / 2; - unsigned y_off = (fb.get_height() - height) / 2; - - daguerre::copy_image(img, fb, 0, 0, x_off, y_off, width, height); - - while (true) { - - uint32_t kp = _syscall_read_key_packet(); - if ((kp & 0x0400ff) == 0x04005a) { - for (unsigned y = 0; y < img.get_height(); ++y) - for (unsigned x = 0; x < img.get_width(); ++x) { - img.get(x, y).r = ~img.get(x, y).r; - img.get(x, y).g = ~img.get(x, y).g; - img.get(x, y).b = ~img.get(x, y).b; - } - daguerre::copy_image(img, fb, 0, 0, x_off, y_off, width, height); - } - - } - - return 0; - -} |