mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
fixing inputs bug, fixing missing depth image destruction in scenes
This commit is contained in:
@@ -6,14 +6,16 @@
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
Inputs::Inputs()
|
||||
void Inputs::FetchInputs()
|
||||
{
|
||||
SDLManager::Get().SetEventCallback([this](mlx_event_type event, int window_id, int code, [[maybe_unused]] void* userdata)
|
||||
SDLManager::Get().InputsFetcher([this](mlx_event_type event, int window_id, int code)
|
||||
{
|
||||
if(m_windows.find(window_id) == m_windows.end())
|
||||
if(!m_windows.contains(window_id))
|
||||
return;
|
||||
if(!m_events_hooks.contains(window_id) || !m_events_hooks[window_id][event].hook)
|
||||
return;
|
||||
m_events_hooks[window_id][event].hook(code, m_events_hooks[window_id][event].param);
|
||||
}, nullptr);
|
||||
});
|
||||
}
|
||||
|
||||
std::int32_t Inputs::GetX() const noexcept
|
||||
|
||||
@@ -7,9 +7,7 @@ namespace mlx
|
||||
{
|
||||
Window::Window(std::size_t w, std::size_t h, const std::string& title, bool hidden) : m_width(w), m_height(h)
|
||||
{
|
||||
static std::uint64_t ids = 0;
|
||||
p_window = SDLManager::Get().CreateWindow(title, w, h, hidden);
|
||||
m_id = ids++;
|
||||
p_window = SDLManager::Get().CreateWindow(title, w, h, hidden, m_id);
|
||||
}
|
||||
|
||||
void Window::Destroy() noexcept
|
||||
|
||||
Reference in New Issue
Block a user