Closed icculus closed 2 years ago
Yeah, it calls SDL_DisplayYUVOverlay() in a tight loop.
Sticking an SDL_PumpEvents() in the loop gets a single frame to draw but the image doesn't animate a slide across the window. Needs more research.
Sticking an SDL_PumpEvents() in the loop gets a single frame to draw but the image doesn't animate a slide across the window. Needs more research.
This is because sdl12-compat only draws the overlay at the display's refresh rate, and its version of SDL_DisplayYUVOverlay basically just queues up a draw and returns immediately, so the loop runs through super-fast and never gets a chance to do a second present. Adding an SDL_Delay and an SDL_PumpEvents fixes it.
testoverlay is sort of a pathological case, since nothing would ever really do this in real life (draw overlays as fast as possible without any event loop or animation timing), so we're probably okay to not fix this...but I'm going to try something real fast before I close this.
Okay, found a reasonable workaround.
It just makes a black window, and then quits:
Does this in classic SDL 1.2, on x11:
Might just fail to present in the short time frame, or need a pumpevents, I don't know yet.