WIP SDL3 compatibility

This commit is contained in:
Cameron Gutman
2025-01-31 01:13:17 -06:00
parent 5290305944
commit 231a67946d
34 changed files with 772 additions and 497 deletions
@@ -98,11 +98,7 @@ int Pacer::vsyncThread(void *context)
{
Pacer* me = reinterpret_cast<Pacer*>(context);
#if SDL_VERSION_ATLEAST(2, 0, 9)
SDL_SetThreadPriority(SDL_THREAD_PRIORITY_TIME_CRITICAL);
#else
SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH);
#endif
SDL_SetCurrentThreadPriority(SDL_THREAD_PRIORITY_TIME_CRITICAL);
bool async = me->m_VsyncSource->isAsync();
while (!me->m_Stopping) {
@@ -131,7 +127,7 @@ int Pacer::renderThread(void* context)
{
Pacer* me = reinterpret_cast<Pacer*>(context);
if (SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH) < 0) {
if (!SDL_SetCurrentThreadPriority(SDL_THREAD_PRIORITY_HIGH)) {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION,
"Unable to set render thread to high priority: %s",
SDL_GetError());
@@ -183,7 +179,7 @@ void Pacer::enqueueFrameForRenderingAndUnlock(AVFrame *frame)
SDL_Event event;
// For main thread rendering, we'll push an event to trigger a callback
event.type = SDL_USEREVENT;
event.type = SDL_EVENT_USER;
event.user.code = SDL_CODE_FRAME_READY;
SDL_PushEvent(&event);
}