From 6a5d5b204569fc6abe6cb5a8ac338350eb5e923d Mon Sep 17 00:00:00 2001 From: Claudius 'keldu' Holeksa Date: Tue, 6 Aug 2024 16:13:50 +0200 Subject: Fixed xcb windows --- modules/window/examples/window_create.cpp | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'modules/window/examples/window_create.cpp') diff --git a/modules/window/examples/window_create.cpp b/modules/window/examples/window_create.cpp index dde8295..3517dae 100644 --- a/modules/window/examples/window_create.cpp +++ b/modules/window/examples/window_create.cpp @@ -1,4 +1,54 @@ +#include "../c++/window.hpp" + +#include + int main(){ + auto eo_aio = saw::setup_async_io(); + if(eo_aio.is_error()){ + auto& err = eo_aio.get_error(); + std::cerr<<"Error: "< 0u){ + std::cerr<<" - "< 0u){ + std::cerr<<" - "<create_window({}, "foo"); + if(!window){ + return 42; + } + window->show(); + + bool running = true; + + aio.event_port.on_signal(saw::Signal::Terminate).then([&running](){ + running = false; + }).detach(); + while(running){ + device->flush(); + wait.wait(std::chrono::seconds{1u}); + } return 0; } -- cgit v1.2.3