41 lines
890 B
C++
41 lines
890 B
C++
/*
|
|
|
|
Código fuente creado por JailDesigner
|
|
Empezado en Castalla el 01/07/2022.
|
|
|
|
*/
|
|
|
|
#define SDL_MAIN_USE_CALLBACKS 1
|
|
|
|
#include <SDL3/SDL.h>
|
|
#include <SDL3/SDL_main.h>
|
|
|
|
#include "core/system/director.hpp"
|
|
#include "core/system/event_buffer.hpp"
|
|
|
|
SDL_AppResult SDL_AppInit(void** appstate, int argc, char* argv[]) {
|
|
(void)argc;
|
|
(void)argv;
|
|
|
|
auto* director = new Director();
|
|
*appstate = director;
|
|
return SDL_APP_CONTINUE;
|
|
}
|
|
|
|
SDL_AppResult SDL_AppEvent(void* appstate, SDL_Event* event) {
|
|
(void)appstate;
|
|
EventBuffer::events.push_back(*event);
|
|
return SDL_APP_CONTINUE;
|
|
}
|
|
|
|
SDL_AppResult SDL_AppIterate(void* appstate) {
|
|
auto* director = static_cast<Director*>(appstate);
|
|
return director->iterate();
|
|
}
|
|
|
|
void SDL_AppQuit(void* appstate, SDL_AppResult result) {
|
|
(void)result;
|
|
auto* director = static_cast<Director*>(appstate);
|
|
delete director;
|
|
}
|