From 9ce4eb86a9571cc025d058ca8433c19b9b393a87 Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Fri, 3 Nov 2023 16:35:33 +0100 Subject: window: implementing more missing funcs --- c++/window/xcb.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'c++/window/xcb.cpp') diff --git a/c++/window/xcb.cpp b/c++/window/xcb.cpp index 5f3485c..1b804ba 100644 --- a/c++/window/xcb.cpp +++ b/c++/window/xcb.cpp @@ -237,12 +237,26 @@ void window::hide(){ xcb_unmap_window(device_->xcb_connection_, xcb_window_); } +const video_mode& window::get_video_mode() const { + return video_mode_; +} + const std::string_view window::get_title() const { return window_title_; } -const video_mode& window::get_video_mode() const { - return video_mode_; +void window::resize(uint64_t w, uint64_t h){ + const uint32_t values[2] = { + static_cast(w), + static_cast(h) + }; + + xcb_configure_window(device_->xcb_connection_, xcb_window_, + XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, + values); + + video_mode_.width = w; + video_mode_.height = h; } conveyor> window::on_event() { -- cgit v1.2.3