diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2021-01-09 23:31:58 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2021-01-09 23:31:58 +0100 |
| commit | 78302e1982c1b7b727c95603611b19913f5c13d0 (patch) | |
| tree | 0389c971c0941006a9544beb48dc72136662050b /src/window.cpp | |
| parent | 2db0d27e7f1744443958717c19b732eed57455f2 (diff) | |
XCB window creation
Diffstat (limited to 'src/window.cpp')
| -rw-r--r-- | src/window.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp new file mode 100644 index 0000000..93c7517 --- /dev/null +++ b/src/window.cpp @@ -0,0 +1,28 @@ +#include "window.hpp" + +window::window() { + connection = xcb_connect(NULL, NULL); + win = xcb_generate_id(connection); + + auto setup = xcb_get_setup (connection); + auto screen_info = xcb_setup_roots_iterator(setup).data; + + xcb_create_window( + connection, + XCB_COPY_FROM_PARENT, + win, + screen_info->root, + 10, + 10, + 400, + 400, + 10, + XCB_WINDOW_CLASS_INPUT_OUTPUT, + screen_info->root_visual, + 0, + nullptr + ); + + xcb_map_window(connection, win); + xcb_flush(connection); +} |
