2021-02-21 19:53:17 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <SDL/SDL.h>
|
|
|
|
|
2021-09-12 03:18:12 +00:00
|
|
|
#include <media-layer/internal.h>
|
2021-11-14 04:29:48 +00:00
|
|
|
#include <media-layer/core.h>
|
2024-05-12 01:14:14 +00:00
|
|
|
#include <libreborn/libreborn.h>
|
2021-06-17 21:32:24 +00:00
|
|
|
|
2021-02-21 19:53:17 +00:00
|
|
|
// SDL Is Replaced With GLFW
|
|
|
|
|
|
|
|
int SDL_Init(__attribute__((unused)) uint32_t flags) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Event Queue
|
|
|
|
|
|
|
|
static std::vector<SDL_Event> queue;
|
|
|
|
|
|
|
|
int SDL_PollEvent(SDL_Event *event) {
|
2021-06-17 21:32:24 +00:00
|
|
|
// Handle External Events
|
|
|
|
_media_handle_SDL_PollEvent();
|
|
|
|
|
|
|
|
// Poll Event
|
2021-02-21 19:53:17 +00:00
|
|
|
int ret;
|
|
|
|
if (queue.size() > 0) {
|
|
|
|
*event = queue[0];
|
|
|
|
queue.erase(queue.begin());
|
|
|
|
ret = 1;
|
|
|
|
} else {
|
|
|
|
ret = 0;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
int SDL_PushEvent(SDL_Event *event) {
|
|
|
|
queue.push_back(*event);
|
|
|
|
return 1;
|
|
|
|
}
|
2021-11-14 04:29:48 +00:00
|
|
|
|
|
|
|
void media_ensure_loaded() {
|
|
|
|
// NOP
|
|
|
|
}
|