use std::any

This commit is contained in:
2025-05-05 13:17:38 -05:00
parent c2da1944d8
commit f35c58d3d6
9 changed files with 171 additions and 153 deletions

View File

@@ -78,22 +78,8 @@ void ImguiModule::onLoad() {
#if WINDOW == 2
ecmd_it = wm->addEventFn([this](Archimedes::Event* e){
if(e->userData != nullptr) {
unsigned int type = app->getEventType(*e);
if(type == app->getEventType(Archimedes::ResizeWindowEvent())
|| type == app->getEventType(Archimedes::CloseWindowEvent())
|| type == app->getEventType(Archimedes::KeyPressedWindowEvent())
|| type == app->getEventType(Archimedes::KeyReleasedWindowEvent())
|| type == app->getEventType(Archimedes::MouseButtonPressedWindowEvent())
|| type == app->getEventType(Archimedes::MouseButtonReleasedWindowEvent())
|| type == app->getEventType(Archimedes::ScrollWindowEvent())
|| type == app->getEventType(Archimedes::MouseMovedWindowEvent())
|| type == app->getEventType(Archimedes::FocusedWindowEvent())
|| type == app->getEventType(Archimedes::FocusLostWindowEvent())
|| type == app->getEventType(Archimedes::MovedWindowEvent())) {
ImGui_ImplSDL3_ProcessEvent((SDL_Event*) e->userData);
}
if(e->userData.type() == std::typeid(SDL_Event*)) {
ImGui_ImplSDL3_ProcessEvent(std::any_cast<SDL_Event*>(e.userData));
}
});
#endif