On Android, if you create a window with SDL_WINDOW_OPENGL, you can't create a Vulkan surface. The error message has been improved to reflect this, and the error is propagated back up to the application.
Also added warn level logging if the renderer couldn't be created.
This was added in 2016, presumably to help address the move/resize issues on Windows, which have been since been addressed by the live-resize functionality.
Fixes https://github.com/libsdl-org/SDL/issues/14079
Test code:
---
int main( int argc, char *argv[] )
{
SDL_Surface *orig = SDL_LoadPNG("testyuv.png");
SDL_Surface *surf16 = SDL_ConvertSurface(orig, SDL_PIXELFORMAT_RGB565);
SDL_Surface *surf32 = SDL_ConvertSurface(surf16, SDL_PIXELFORMAT_ARGB8888);
Uint64 then = SDL_GetTicks();
for (int i = 0; i < 100000; ++i) {
SDL_BlitSurface(surf16, NULL, surf32, NULL);
}
Uint64 now = SDL_GetTicks();
SDL_Log("Blit took %d ms\n", (int)(now - then));
return 0;
}
---
Results on my system:
BlitNtoN: Blit took 34522 ms
Blit_RGB565_32 (3 LUT): Blit took 9316 ms
Blit_RGB565_32 (1 LUT): Blit took 5268 ms
Blit_RGB565_32_SSE41: Blit took 1619 ms
This beats the previous 3-LUT version and even beats SSE on my system.
Test code:
---
int main( int argc, char *argv[] )
{
SDL_Surface *orig = SDL_LoadPNG("testyuv.png");
SDL_Surface *surf16 = SDL_ConvertSurface(orig, SDL_PIXELFORMAT_RGB565);
SDL_Surface *surf32 = SDL_ConvertSurface(surf16, SDL_PIXELFORMAT_ARGB8888);
Uint64 then = SDL_GetTicks();
for (int i = 0; i < 100000; ++i) {
SDL_BlitSurface(surf16, NULL, surf32, NULL);
}
Uint64 now = SDL_GetTicks();
SDL_Log("Blit took %d ms\n", (int)(now - then));
return 0;
}
---
Results on my system:
BlitNtoN: Blit took 34522 ms
Blit_RGB565_32 (3 LUT): Blit took 9316 ms
Blit_RGB565_32 (1 LUT): Blit took 5268 ms
Blit_RGB565_32_SSE41: Blit took 6399 ms
Tray events on *nix platforms usually run over DBus, and the events subsequently aren't delivered via the window event queue. As a result, SDL_WaitEvent() won't unblock when tray events arrive, particularly if there is no currently active window.
Wake up periodically to poll when tray items are active to avoid blocking the delivery and processing of tray events.
While in a modal loop, the size in WM_WINDOWPOSCHANGING/WM_WINDOWPOSCHANGED may only be updated if the window is being resized interactively. Set the SWP_NOSIZE flag if the size hasn't changed from the last move/size event, or a size set programmatically may end up being overwritten by old size data.