Files
coffee_crisis_arcade_edition/source/global_events.cpp
2025-03-25 20:26:45 +01:00

30 lines
1.0 KiB
C++

#include "global_events.h"
#include <SDL3/SDL_video.h> // Para SDL_WINDOWEVENT_SIZE_CHANGED
#include <iostream> // Para char_traits, basic_ostream, operator<<
#include "mouse.h" // Para handleEvent
#include "section.h" // Para Name, Options, name, options
namespace globalEvents
{
// Comprueba los eventos que se pueden producir en cualquier sección del juego
void check(const SDL_Event &event)
{
switch (event.type)
{
case SDL_EVENT_QUIT: // Evento de salida de la aplicación
section::name = section::Name::QUIT;
section::options = section::Options::QUIT_FROM_EVENT;
return;
case SDL_EVENT_RENDER_DEVICE_RESET:
case SDL_EVENT_RENDER_TARGETS_RESET:
std::cout << "SDL_RENDER_TARGETS_RESET" << std::endl;
break;
case SDL_EVENT_WINDOW_RESIZED:
std::cout << "SDL_WINDOWEVENT_SIZE_CHANGED" << std::endl;
break;
default:
break;
}
Mouse::handleEvent(event);
}
}