My phone captured 1920x1080 images even though the highest reported format was higher resolution, so I adjusted testcamera to be able to handle different sized images than expected.
Fixes https://github.com/libsdl-org/SDL/issues/9930
It's possible to destroy an SDL_Renderer without freeing it using
SDL_DestroyRendererWithoutFreeing(), which is used to make it possible
to destroy windows and their renderers in either order. However, if a
renderer has already been destroyed before it is freed (e.g., the window
was destroyed before the renderer), the object is never marked invalid.
This means the SDL_Renderer is reported as leaked, even if
SDL_DestroyRenderer() is called.
SDL_GetWindowSurface() will trigger this, as the window texture is
cleaned up _after_ the window destroys its associated renderer. This
makes it impossible to use SDL_FRAMEBUFFER_ACCELERATION without
triggering a leak warning.
Fix this by unconditionally marking the SDL_Renderer object as invalid
in SDL_DestroyRenderer().
This declares that any `const char *` returned from SDL is owned by SDL, and
promises to be valid _at least_ until the next time the event queue runs, or
SDL_Quit() is called, even if the thing that owns the string gets destroyed
or changed before then.
This is noted in the headers as "the SDL_GetStringRule", so this will both be
greppable to find a detailed explaination in docs/README-strings.md and
wikiheaders will automatically turn it into a link we can point at the
appropriate documentation.
Fixes#9902.
(and several FIXMEs, both known and yet-undocumented.)
GCC 15 development branch provides an experimental support for Windows on ARM64, which will be officially released next year, according to latest news.
I tried to compile SDL2 with this new compiler but I got a tiny problem into SDL_assert.h because it couldn't find the right platform.
However, it has been easy to fix and I included it into this PR.
More details can be also found here:
https://learn.microsoft.com/en-us/cpp/intrinsics/debugbreak?view=msvc-170
(cherry picked from commit 2cb1a2d0a7f1c9cb3177c907758322899c3041d5)
avoids -Wformat warnings from mingw toolchains -- e.g.:
src/test/SDL_test_harness.c:581:37: warning: unknown conversion type character 'l' in format [-Wformat=]
Borderless windows flagged as fullscreen at creation time turn on the borders, because doing so prevents some window managers from wrongly positioning the borderless window, and in these cases the borders need to be removed whether fullscreen is exited programmatically or via a compositor event. Set a flag when forcing the borders on, so they will be removed in all cases later.
The 'all-in-one' test fails for Emscripten because try_compile does not copy back the actual binary:
the wasm file contains the machine parseable strings, not the html or js file(s).
Custom theme file exists in project, but is not used by app, which is kinda unintuitive. Using it by default so people who not familiar with Android development won't spend lots of time troubleshooting.