Files
coffee_crisis_arcade_edition/source/global_events.cpp
2025-03-27 09:43:19 +01:00

29 lines
991 B
C++

#include "global_events.h"
#include <iostream> // Para char_traits, basic_ostream, operator<<, cout, endl
#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);
}
}