This repository has been archived on 2025-02-26. You can view files and clone it, but cannot push or open issues or pull requests.
hilbert-os/applications/hello/source/main.cpp

30 lines
810 B
C++

#include <pake/widgets/fixed-text.hpp>
#include <daguerre/psf.hpp>
#include <pake/window.hpp>
daguerre::fixed_font<bool> *font;
int main(int, char **) {
font = new daguerre::fixed_font<bool>(
daguerre::try_load_psf("/assets/terminus-bold-18x10.psf").value());
pake::widgets::fixed_text *text =
new pake::widgets::fixed_text("Hello, world!", font,
euler::syscall::encode_color(0xaa, 0xaa, 0xaa),
euler::syscall::encode_color(0x00, 0x00, 0x00));
pake::window w(300, 200, "Hello");
w.set_root(std::unique_ptr<pake::widget>(text));
w.render_and_send_to_compositor();
w.show();
//TODO: call event loop
euler::syscall::stream_handle h1, h2;
euler::syscall::create_private_socket(h1, h2);
uint8_t byte;
while (1)
euler::syscall::read_from_stream(h1, 1, &byte);
}