From b5983ac24b7beb76540dbc0dddf9387b9fc92fcd Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Wed, 27 Mar 2024 13:19:28 +0100 Subject: [PATCH] renaming MLX_Window to Window --- src/core/graphics.cpp | 4 ++-- src/core/graphics.h | 6 +++--- src/core/graphics.inl | 2 +- src/platform/inputs.h | 6 +++--- src/platform/window.cpp | 6 +++--- src/platform/window.h | 8 ++++---- src/pre_compiled.h | 7 ++++++- src/renderer/renderer.h | 8 ++++---- 8 files changed, 26 insertions(+), 21 deletions(-) diff --git a/src/core/graphics.cpp b/src/core/graphics.cpp index 3b8604d..6be4395 100644 --- a/src/core/graphics.cpp +++ b/src/core/graphics.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/02 15:13:55 by maldavid #+# #+# */ -/* Updated: 2024/03/25 23:02:43 by maldavid ### ########.fr */ +/* Updated: 2024/03/27 00:32:34 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -32,7 +32,7 @@ namespace mlx } GraphicsSupport::GraphicsSupport(std::size_t w, std::size_t h, std::string title, int id) : - _window(std::make_shared(w, h, title)), + _window(std::make_shared(w, h, title)), _renderer(std::make_unique()), _width(w), _height(h), diff --git a/src/core/graphics.h b/src/core/graphics.h index 25b0aa6..bb9935d 100644 --- a/src/core/graphics.h +++ b/src/core/graphics.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/02 14:49:49 by maldavid #+# #+# */ -/* Updated: 2024/03/25 23:00:43 by maldavid ### ########.fr */ +/* Updated: 2024/03/27 00:32:28 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -32,7 +32,7 @@ namespace mlx GraphicsSupport(std::size_t w, std::size_t h, std::string title, int id); inline int& getID() noexcept; - inline std::shared_ptr getWindow(); + inline std::shared_ptr getWindow(); void render() noexcept; @@ -59,7 +59,7 @@ namespace mlx glm::mat4 _proj = glm::mat4(1.0); - std::shared_ptr _window; + std::shared_ptr _window; std::unique_ptr _renderer; std::size_t _width = 0; diff --git a/src/core/graphics.inl b/src/core/graphics.inl index 97958e0..c6f60f6 100644 --- a/src/core/graphics.inl +++ b/src/core/graphics.inl @@ -15,7 +15,7 @@ namespace mlx { int& GraphicsSupport::getID() noexcept { return _id; } - std::shared_ptr GraphicsSupport::getWindow() { return _window; } + std::shared_ptr GraphicsSupport::getWindow() { return _window; } void GraphicsSupport::clearRenderData() noexcept { diff --git a/src/platform/inputs.h b/src/platform/inputs.h index 2359dce..7cd9078 100644 --- a/src/platform/inputs.h +++ b/src/platform/inputs.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/05 16:27:35 by maldavid #+# #+# */ -/* Updated: 2024/03/25 23:03:39 by maldavid ### ########.fr */ +/* Updated: 2024/03/27 00:31:56 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -41,7 +41,7 @@ namespace mlx inline bool isRunning() const noexcept { return !_end; } inline constexpr void finish() noexcept { _end = true; } - inline void addWindow(std::shared_ptr window) + inline void addWindow(std::shared_ptr window) { _windows[window->getID()] = window; _events_hooks[window->getID()] = {}; @@ -56,7 +56,7 @@ namespace mlx ~Input() = default; private: - std::unordered_map> _windows; + std::unordered_map> _windows; std::unordered_map> _events_hooks; int _x = 0; diff --git a/src/platform/window.cpp b/src/platform/window.cpp index 01f031d..182f18f 100644 --- a/src/platform/window.cpp +++ b/src/platform/window.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 17:36:44 by maldavid #+# #+# */ -/* Updated: 2024/03/25 22:17:34 by maldavid ### ########.fr */ +/* Updated: 2024/03/26 23:03:59 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,7 +18,7 @@ namespace mlx { - MLX_Window::MLX_Window(std::size_t w, std::size_t h, const std::string& title) : _width(w), _height(h) + Window::Window(std::size_t w, std::size_t h, const std::string& title) : _width(w), _height(h) { static std::uint64_t ids = 0; @@ -29,7 +29,7 @@ namespace mlx _id = ids++; } - void MLX_Window::destroy() noexcept + void Window::destroy() noexcept { if(_win != nullptr) { diff --git a/src/platform/window.h b/src/platform/window.h index 07c4bb2..09202a0 100644 --- a/src/platform/window.h +++ b/src/platform/window.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 21:53:12 by maldavid #+# #+# */ -/* Updated: 2024/03/25 22:11:21 by maldavid ### ########.fr */ +/* Updated: 2024/03/26 23:03:50 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,10 +15,10 @@ namespace mlx { - class MLX_Window + class Window { public: - MLX_Window(std::size_t w, std::size_t h, const std::string& title); + Window(std::size_t w, std::size_t h, const std::string& title); inline GLFWwindow* getNativeWindow() const noexcept { return _win; } inline int getWidth() const noexcept { return _width; } @@ -27,7 +27,7 @@ namespace mlx void destroy() noexcept; - ~MLX_Window() = default; + ~Window() = default; private: GLFWimage _icon; diff --git a/src/pre_compiled.h b/src/pre_compiled.h index e27194e..313cd6f 100644 --- a/src/pre_compiled.h +++ b/src/pre_compiled.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/03/25 17:37:23 by maldavid #+# #+# */ -/* Updated: 2024/03/25 22:03:44 by maldavid ### ########.fr */ +/* Updated: 2024/03/27 00:39:13 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,8 +15,11 @@ #define VK_NO_PROTOTYPES +#define Window X11Window // fuck X11 + #include #include +#include #include #include #include @@ -69,4 +72,6 @@ #include #endif +#undef Window + #endif diff --git a/src/renderer/renderer.h b/src/renderer/renderer.h index c935a1c..bd347d2 100644 --- a/src/renderer/renderer.h +++ b/src/renderer/renderer.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/12/18 17:14:45 by maldavid #+# #+# */ -/* Updated: 2024/03/25 19:07:52 by maldavid ### ########.fr */ +/* Updated: 2024/03/27 00:31:28 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -86,8 +86,8 @@ namespace mlx void destroy(); - inline class MLX_Window* getWindow() { return _window; } - inline void setWindow(class MLX_Window* window) { _window = window; } + inline class Window* getWindow() { return _window; } + inline void setWindow(class Window* window) { _window = window; } inline Surface& getSurface() noexcept { return _surface; } inline CmdPool& getCmdPool() noexcept { return _cmd.getCmdPool(); } @@ -130,7 +130,7 @@ namespace mlx std::unique_ptr _uniform_buffer; - class MLX_Window* _window = nullptr; + class Window* _window = nullptr; class Texture* _render_target = nullptr; std::uint32_t _current_frame_index = 0;