renaming MLX_Window to Window

This commit is contained in:
Kbz-8
2024-03-27 13:19:28 +01:00
parent abc213c808
commit b5983ac24b
8 changed files with 26 additions and 21 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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<MLX_Window>(w, h, title)),
_window(std::make_shared<Window>(w, h, title)),
_renderer(std::make_unique<Renderer>()),
_width(w),
_height(h),

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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<MLX_Window> getWindow();
inline std::shared_ptr<Window> getWindow();
void render() noexcept;
@@ -59,7 +59,7 @@ namespace mlx
glm::mat4 _proj = glm::mat4(1.0);
std::shared_ptr<MLX_Window> _window;
std::shared_ptr<Window> _window;
std::unique_ptr<Renderer> _renderer;
std::size_t _width = 0;

View File

@@ -15,7 +15,7 @@
namespace mlx
{
int& GraphicsSupport::getID() noexcept { return _id; }
std::shared_ptr<MLX_Window> GraphicsSupport::getWindow() { return _window; }
std::shared_ptr<Window> GraphicsSupport::getWindow() { return _window; }
void GraphicsSupport::clearRenderData() noexcept
{

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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<MLX_Window> window)
inline void addWindow(std::shared_ptr<Window> window)
{
_windows[window->getID()] = window;
_events_hooks[window->getID()] = {};
@@ -56,7 +56,7 @@ namespace mlx
~Input() = default;
private:
std::unordered_map<std::uint32_t, std::shared_ptr<MLX_Window>> _windows;
std::unordered_map<std::uint32_t, std::shared_ptr<Window>> _windows;
std::unordered_map<std::uint32_t, std::array<Hook, 6>> _events_hooks;
int _x = 0;

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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)
{

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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;

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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 <mlx_profile.h>
#include <cstdio>
#include <cstdarg>
#include <iostream>
#include <volk.h>
#include <GLFW/glfw3.h>
@@ -69,4 +72,6 @@
#include <vma.h>
#endif
#undef Window
#endif

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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<UBO> _uniform_buffer;
class MLX_Window* _window = nullptr;
class Window* _window = nullptr;
class Texture* _render_target = nullptr;
std::uint32_t _current_frame_index = 0;