mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 22:53:34 +00:00
fixing compilation issues
This commit is contained in:
@@ -13,9 +13,7 @@ namespace mlx
|
||||
EventBus::RegisterListener({[](const EventBase& event)
|
||||
{
|
||||
if(event.What() == Event::FatalErrorEventCode)
|
||||
{
|
||||
std::abort();
|
||||
}
|
||||
}, "__MlxApplication" });
|
||||
|
||||
m_fps.Init();
|
||||
|
||||
@@ -38,11 +38,11 @@ namespace mlx
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case LogType::Debug: std::cout << Ansi::blue << "[Akel Debug] " << Ansi::def << code_infos << message << '\n'; break;
|
||||
case LogType::Message: std::cout << Ansi::blue << "[Akel Message] " << Ansi::def << code_infos << message << '\n'; break;
|
||||
case LogType::Warning: std::cout << Ansi::magenta << "[Akel Warning] " << Ansi::def << code_infos << message << '\n'; break;
|
||||
case LogType::Error: std::cerr << Ansi::red << "[Akel Error] " << Ansi::def << code_infos << message << '\n'; break;
|
||||
case LogType::FatalError: std::cerr << Ansi::red << "[Akel Fatal Error] " << Ansi::def << code_infos << message << '\n'; break;
|
||||
case LogType::Debug: std::cout << Ansi::blue << "[MLX Debug] " << Ansi::def << code_infos << message << '\n'; break;
|
||||
case LogType::Message: std::cout << Ansi::blue << "[MLX Message] " << Ansi::def << code_infos << message << '\n'; break;
|
||||
case LogType::Warning: std::cout << Ansi::magenta << "[MLX Warning] " << Ansi::def << code_infos << message << '\n'; break;
|
||||
case LogType::Error: std::cerr << Ansi::red << "[MLX Error] " << Ansi::def << code_infos << message << '\n'; break;
|
||||
case LogType::FatalError: std::cerr << Ansi::red << "[MLX Fatal Error] " << Ansi::def << code_infos << message << '\n'; break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -56,10 +56,6 @@ namespace mlx
|
||||
{
|
||||
WatcherData* data = static_cast<WatcherData*>(userdata);
|
||||
|
||||
if(event->type == SDL_MOUSEMOTION)
|
||||
{
|
||||
}
|
||||
|
||||
std::uint32_t id = event->window.windowID;
|
||||
switch(event->type)
|
||||
{
|
||||
@@ -102,6 +98,7 @@ namespace mlx
|
||||
|
||||
return 0;
|
||||
}, &watcher_data);
|
||||
DebugLog("SDL Manager initialized");
|
||||
}
|
||||
|
||||
void* SDLManager::CreateWindow(const std::string& title, std::size_t w, std::size_t h, bool hidden)
|
||||
@@ -162,11 +159,44 @@ namespace mlx
|
||||
return Vec2ui{ extent };
|
||||
}
|
||||
|
||||
std::int32_t SDLManager::GetX() const noexcept
|
||||
{
|
||||
int dummy;
|
||||
int x;
|
||||
SDL_GetMouseState(&x, &dummy);
|
||||
return x;
|
||||
}
|
||||
|
||||
std::int32_t SDLManager::GetY() const noexcept
|
||||
{
|
||||
int dummy;
|
||||
int y;
|
||||
SDL_GetMouseState(&dummy, &y);
|
||||
return y;
|
||||
}
|
||||
|
||||
std::int32_t SDLManager::GetXRel() const noexcept
|
||||
{
|
||||
int dummy;
|
||||
int x;
|
||||
SDL_GetRelativeMouseState(&x, &dummy);
|
||||
return x;
|
||||
}
|
||||
|
||||
std::int32_t SDLManager::GetYRel() const noexcept
|
||||
{
|
||||
int dummy;
|
||||
int y;
|
||||
SDL_GetRelativeMouseState(&dummy, &y);
|
||||
return y;
|
||||
}
|
||||
|
||||
void SDLManager::Shutdown() noexcept
|
||||
{
|
||||
if(m_drop_sdl_responsability)
|
||||
return;
|
||||
SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_EVENTS);
|
||||
SDL_Quit();
|
||||
DebugLog("SDL Manager uninitialized");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user