fixing macOS issue

This commit is contained in:
2025-01-11 22:28:39 +01:00
parent 12c7469f52
commit ef16cd3fdb
12 changed files with 12 additions and 644 deletions

View File

@@ -44,10 +44,10 @@ namespace mlx
private:
struct Hook
{
func::function<void(void*)> fn;
std::function<void(void*)> fn;
void* param;
Hook(func::function<void(void*)> fn, void* param) : fn(fn), param(param) {}
Hook(std::function<void(void*)> fn, void* param) : fn(fn), param(param) {}
};
private:

View File

@@ -9,7 +9,7 @@ namespace mlx
{
public:
EventListener() = delete;
EventListener(func::function<void(const EventBase&)> functor, std::string name);
EventListener(std::function<void(const EventBase&)> functor, std::string name);
inline const std::string& GetName() const { return m_name; }
inline void Call(const EventBase& event) const noexcept { m_listen_functor(event); }
@@ -17,7 +17,7 @@ namespace mlx
~EventListener() = default;
private:
func::function<void(const EventBase&)> m_listen_functor;
std::function<void(const EventBase&)> m_listen_functor;
std::string m_name;
};
}

View File

@@ -14,7 +14,7 @@ namespace mlx
Handle CreateWindow(const mlx_window_create_info* info, std::int32_t& id, bool hidden);
void DestroyWindow(Handle window) noexcept;
void InputsFetcher(func::function<void(mlx_event_type, int, int)> functor);
void InputsFetcher(std::function<void(mlx_event_type, int, int)> functor);
VkSurfaceKHR CreateVulkanSurface(Handle window, VkInstance instance) const noexcept;
std::vector<const char*> GetRequiredVulkanInstanceExtentions(Handle window) const noexcept;

View File

@@ -12,10 +12,10 @@ namespace mlx
public:
struct Hook
{
func::function<void(int, void*)> fn;
std::function<void(int, void*)> fn;
void* param = nullptr;
Hook(func::function<void(int, void*)> fn, void* param) : fn(fn), param(param) {}
Hook(std::function<void(int, void*)> fn, void* param) : fn(fn), param(param) {}
};
public:

View File

@@ -28,7 +28,6 @@
#include <string_view>
#include <chrono>
#include <unordered_set>
#include <function.h>
#include <array>
#include <cstdint>
#include <cstring>

View File

@@ -1,4 +1,3 @@
#include "mlx_extended.h"
#include <PreCompiled.h>
#include <Core/Application.h>

View File

@@ -3,7 +3,7 @@
namespace mlx
{
EventListener::EventListener(func::function<void(const EventBase&)> functor, std::string name)
EventListener::EventListener(std::function<void(const EventBase&)> functor, std::string name)
: m_listen_functor(std::move(functor)), m_name(std::move(name))
{}
}

View File

@@ -216,7 +216,7 @@ namespace mlx
return y;
}
void SDLManager::InputsFetcher(func::function<void(mlx_event_type, int, int)> functor)
void SDLManager::InputsFetcher(std::function<void(mlx_event_type, int, int)> functor)
{
SDL_Event event;
while(SDL_PollEvent(&event))

View File

@@ -45,7 +45,7 @@ namespace mlx
};
p_fragment_shader = std::make_shared<Shader>(fragment_shader_code, ShaderType::Fragment, std::move(fragment_shader_layout));
func::function<void(const EventBase&)> functor = [this](const EventBase& event)
std::function<void(const EventBase&)> functor = [this](const EventBase& event)
{
if(event.What() == Event::ResizeEventCode)
m_pipeline.Destroy();

View File

@@ -31,7 +31,7 @@ namespace mlx
};
p_fragment_shader = std::make_shared<Shader>(fragment_shader_code, ShaderType::Fragment, std::move(fragment_shader_layout));
func::function<void(const EventBase&)> functor = [this](const EventBase& event)
std::function<void(const EventBase&)> functor = [this](const EventBase& event)
{
if(event.What() == Event::ResizeEventCode)
m_pipeline.Destroy();

View File

@@ -11,7 +11,7 @@ namespace mlx
m_2Dpass.Init();
m_final.Init();
func::function<void(const EventBase&)> functor = [this](const EventBase& event)
std::function<void(const EventBase&)> functor = [this](const EventBase& event)
{
if(event.What() == Event::ResizeEventCode)
m_main_render_texture.Destroy();