From dd5d61330032511f5b0e05e813bbfe2054841f5d Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 29 Jun 2023 13:10:00 +0200 Subject: c++,window: Reworking the context creation --- src/window/backends.h | 9 +++++++++ src/window/device.h | 7 +++++++ src/window/linux_xcb.h | 5 +++++ src/window/xcb.h | 9 ++++++++- 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/window/backends.h create mode 100644 src/window/linux_xcb.h (limited to 'src') diff --git a/src/window/backends.h b/src/window/backends.h new file mode 100644 index 0000000..2548dc5 --- /dev/null +++ b/src/window/backends.h @@ -0,0 +1,9 @@ +#pragma once + +namespace saw { +namespace gfx { +namespace backend { +struct xcb {}; +} +} +} diff --git a/src/window/device.h b/src/window/device.h index 2796d4d..c547da2 100644 --- a/src/window/device.h +++ b/src/window/device.h @@ -8,6 +8,11 @@ #include "window.h" +namespace saw { +namespace gfx { +template +class device; +} /** namespace saw { class device { @@ -23,3 +28,5 @@ class io_provider; own create_device(io_provider &provider); } // namespace saw */ +} +} diff --git a/src/window/linux_xcb.h b/src/window/linux_xcb.h new file mode 100644 index 0000000..65ff94d --- /dev/null +++ b/src/window/linux_xcb.h @@ -0,0 +1,5 @@ +#pragma once + +#ifdef SAW_UNIX_XCB +#include "xcb.h" +#endif diff --git a/src/window/xcb.h b/src/window/xcb.h index 430ea28..bbdf1ed 100644 --- a/src/window/xcb.h +++ b/src/window/xcb.h @@ -4,9 +4,15 @@ #error "XCB is not supported" #endif +#include "backends.h" +#include "device.h" + namespace saw { +namespace gfx { class window; -class device { + +template<> +class device final { private: ::Display *display_; int screen_; @@ -67,3 +73,4 @@ public: void keyboard_event(int16_t x, int16_t y, uint32_t keycode, bool pressed, bool repeat); }; } +} -- cgit v1.2.3