39 lines
656 B
C++
Raw Normal View History

2021-02-21 14:53:17 -05:00
#include <vector>
#include <SDL/SDL.h>
2024-05-11 21:14:14 -04:00
#include <libreborn/libreborn.h>
2021-06-17 17:32:24 -04:00
2024-10-20 01:19:08 -04:00
#include "media.h"
2021-02-21 14:53:17 -05:00
// SDL Is Replaced With GLFW
2024-10-20 01:19:08 -04:00
int media_SDL_Init(__attribute__((unused)) uint32_t flags) {
2021-02-21 14:53:17 -05:00
return 0;
}
// Event Queue
static std::vector<SDL_Event> queue;
2024-10-20 01:19:08 -04:00
int media_SDL_PollEvent(SDL_Event *event) {
2021-06-17 17:32:24 -04:00
// Handle External Events
2024-10-20 01:19:08 -04:00
_media_handle_media_SDL_PollEvent();
2021-06-17 17:32:24 -04:00
// 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;
}
2024-10-20 01:19:08 -04:00
int media_SDL_PushEvent(SDL_Event *event) {
2021-02-21 14:53:17 -05:00
queue.push_back(*event);
return 1;
}