/*

Código fuente creado por JailDesigner
Empezado en Castalla el 01/07/2022.

*/

#define SDL_MAIN_USE_CALLBACKS 1
#include <SDL3/SDL_main.h>

#include "core/system/director.hpp"

auto SDL_AppInit(void** appstate, int /*argc*/, char* /*argv*/[]) -> SDL_AppResult {
    *appstate = new Director();
    return SDL_APP_CONTINUE;
}

auto SDL_AppIterate(void* appstate) -> SDL_AppResult {
    return static_cast<Director*>(appstate)->iterate();
}

auto SDL_AppEvent(void* appstate, SDL_Event* event) -> SDL_AppResult {
    return static_cast<Director*>(appstate)->handleEvent(*event);
}

void SDL_AppQuit(void* appstate, SDL_AppResult /*result*/) {
    delete static_cast<Director*>(appstate);
}
