Afegit global_events.cpp

This commit is contained in:
2025-03-10 23:24:00 +01:00
parent 9d98d3ea6a
commit 482dc3de54
26 changed files with 197 additions and 530 deletions

View File

@@ -16,7 +16,7 @@
#include "texture.h" // Para Texture
#include "utils.h" // Para Zone, BLOCK, Color, bg_color
#include "writer.h" // Para Writer
#include "mouse.h"
#include "global_events.h"
#include <array>
// Constructor
@@ -154,34 +154,9 @@ Intro::Intro()
void Intro::checkEvents()
{
SDL_Event event;
// Comprueba los eventos que hay en la cola
while (SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_QUIT:
{
section::name = section::Name::QUIT;
section::options = section::Options::QUIT_FROM_EVENT;
break;
}
case SDL_WINDOWEVENT:
{
if (event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED)
{
// reloadTextures();
}
break;
}
default:
break;
}
// Comprueba el cursor
Mouse::handleEvent(event);
globalEvents::check(event);
}
}