mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
renaming MLX_Window to Window
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/04/02 15:13:55 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) :
|
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>()),
|
_renderer(std::make_unique<Renderer>()),
|
||||||
_width(w),
|
_width(w),
|
||||||
_height(h),
|
_height(h),
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/04/02 14:49:49 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);
|
GraphicsSupport(std::size_t w, std::size_t h, std::string title, int id);
|
||||||
|
|
||||||
inline int& getID() noexcept;
|
inline int& getID() noexcept;
|
||||||
inline std::shared_ptr<MLX_Window> getWindow();
|
inline std::shared_ptr<Window> getWindow();
|
||||||
|
|
||||||
void render() noexcept;
|
void render() noexcept;
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ namespace mlx
|
|||||||
|
|
||||||
glm::mat4 _proj = glm::mat4(1.0);
|
glm::mat4 _proj = glm::mat4(1.0);
|
||||||
|
|
||||||
std::shared_ptr<MLX_Window> _window;
|
std::shared_ptr<Window> _window;
|
||||||
std::unique_ptr<Renderer> _renderer;
|
std::unique_ptr<Renderer> _renderer;
|
||||||
|
|
||||||
std::size_t _width = 0;
|
std::size_t _width = 0;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
namespace mlx
|
namespace mlx
|
||||||
{
|
{
|
||||||
int& GraphicsSupport::getID() noexcept { return _id; }
|
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
|
void GraphicsSupport::clearRenderData() noexcept
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/10/05 16:27:35 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 bool isRunning() const noexcept { return !_end; }
|
||||||
inline constexpr void finish() noexcept { _end = true; }
|
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;
|
_windows[window->getID()] = window;
|
||||||
_events_hooks[window->getID()] = {};
|
_events_hooks[window->getID()] = {};
|
||||||
@@ -56,7 +56,7 @@ namespace mlx
|
|||||||
~Input() = default;
|
~Input() = default;
|
||||||
|
|
||||||
private:
|
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;
|
std::unordered_map<std::uint32_t, std::array<Hook, 6>> _events_hooks;
|
||||||
|
|
||||||
int _x = 0;
|
int _x = 0;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/10/04 17:36:44 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
|
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;
|
static std::uint64_t ids = 0;
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ namespace mlx
|
|||||||
_id = ids++;
|
_id = ids++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MLX_Window::destroy() noexcept
|
void Window::destroy() noexcept
|
||||||
{
|
{
|
||||||
if(_win != nullptr)
|
if(_win != nullptr)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/10/04 21:53:12 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
|
namespace mlx
|
||||||
{
|
{
|
||||||
class MLX_Window
|
class Window
|
||||||
{
|
{
|
||||||
public:
|
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 GLFWwindow* getNativeWindow() const noexcept { return _win; }
|
||||||
inline int getWidth() const noexcept { return _width; }
|
inline int getWidth() const noexcept { return _width; }
|
||||||
@@ -27,7 +27,7 @@ namespace mlx
|
|||||||
|
|
||||||
void destroy() noexcept;
|
void destroy() noexcept;
|
||||||
|
|
||||||
~MLX_Window() = default;
|
~Window() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GLFWimage _icon;
|
GLFWimage _icon;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/03/25 17:37:23 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 VK_NO_PROTOTYPES
|
||||||
|
|
||||||
|
#define Window X11Window // fuck X11
|
||||||
|
|
||||||
#include <mlx_profile.h>
|
#include <mlx_profile.h>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <cstdarg>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <volk.h>
|
#include <volk.h>
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
@@ -69,4 +72,6 @@
|
|||||||
#include <vma.h>
|
#include <vma.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#undef Window
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2022/12/18 17:14:45 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();
|
void destroy();
|
||||||
|
|
||||||
inline class MLX_Window* getWindow() { return _window; }
|
inline class Window* getWindow() { return _window; }
|
||||||
inline void setWindow(class MLX_Window* window) { _window = window; }
|
inline void setWindow(class Window* window) { _window = window; }
|
||||||
|
|
||||||
inline Surface& getSurface() noexcept { return _surface; }
|
inline Surface& getSurface() noexcept { return _surface; }
|
||||||
inline CmdPool& getCmdPool() noexcept { return _cmd.getCmdPool(); }
|
inline CmdPool& getCmdPool() noexcept { return _cmd.getCmdPool(); }
|
||||||
@@ -130,7 +130,7 @@ namespace mlx
|
|||||||
|
|
||||||
std::unique_ptr<UBO> _uniform_buffer;
|
std::unique_ptr<UBO> _uniform_buffer;
|
||||||
|
|
||||||
class MLX_Window* _window = nullptr;
|
class Window* _window = nullptr;
|
||||||
class Texture* _render_target = nullptr;
|
class Texture* _render_target = nullptr;
|
||||||
|
|
||||||
std::uint32_t _current_frame_index = 0;
|
std::uint32_t _current_frame_index = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user