43 lines
705 B
C++
Raw Normal View History

2021-06-17 17:32:24 -04:00
#include <cstdlib>
2021-02-21 14:53:17 -05:00
#include <vector>
#include <SDL/SDL.h>
2021-09-11 23:18:12 -04:00
#include <media-layer/internal.h>
2021-11-13 23:29:48 -05:00
#include <media-layer/core.h>
2021-06-17 17:32:24 -04:00
2021-02-21 14:53:17 -05: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 17:32:24 -04:00
// Handle External Events
_media_handle_SDL_PollEvent();
// Poll Event
2021-02-21 14:53:17 -05: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-13 23:29:48 -05:00
void media_ensure_loaded() {
// NOP
}