diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mglpp/mglpp.hpp | 12 | ||||
-rw-r--r-- | include/mglpp/window/Window.hpp | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/include/mglpp/mglpp.hpp b/include/mglpp/mglpp.hpp index 2e49da5..730ddf5 100644 --- a/include/mglpp/mglpp.hpp +++ b/include/mglpp/mglpp.hpp @@ -1,9 +1,15 @@ #ifndef MGLPP_MGLPP_HPP #define MGLPP_MGLPP_HPP -#include <stdexcept> +#include <exception> namespace mgl { + enum class WindowSystem { + NATIVE, // Use X11 on X11 and Wayland on Wayland + X11, // Use X11 on X11 and XWayland on Wayland + WAYLAND, // Use Wayland. If user runs on X11 then it fails to connect + }; + class InitException : public std::exception { public: const char* what() const noexcept override { @@ -13,8 +19,8 @@ namespace mgl { class Init { public: - // Throws InitException on failure - Init(); + // Throws InitException on failure. + Init(WindowSystem window_system = WindowSystem::X11); ~Init(); bool is_connected_to_display_server(); diff --git a/include/mglpp/window/Window.hpp b/include/mglpp/window/Window.hpp index 6bd77f8..8458d71 100644 --- a/include/mglpp/window/Window.hpp +++ b/include/mglpp/window/Window.hpp @@ -55,7 +55,7 @@ namespace mgl { const char *class_name = nullptr; mgl_window_type window_type = MGL_WINDOW_TYPE_NORMAL; WindowHandle transient_for_window = 0; /* 0 = none */ - mgl_render_api render_api = MGL_RENDER_API_GLX; + mgl_graphics_api graphics_api = MGL_GRAPHICS_API_EGL; }; Window(); @@ -123,6 +123,7 @@ namespace mgl { mgl_window* internal_window(); private: mgl_window window; + bool window_created = false; }; } |