WIP SDL3 compatibility
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user