Phones: sideways only; back from the background the Vulkan surface is made again (it was lost), the work saved on the way out and carried on with on the next start if the phone closed it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nexoniarz 2026-10-21 00:16:22 +02:00
commit a79a6c9020
9 changed files with 87 additions and 2 deletions

View file

@ -218,6 +218,8 @@ public:
virtual void beginUi() = 0;
virtual void setVsync(bool on) = 0;
virtual void onResize() = 0;
// Back from the background (a phone): the window's surface may be a new one.
virtual void onSurfaceLost() { onResize(); }
// A texture in table slot `slot`, mips largest first: RGBA8 pixels, or BC7 blocks (YAPF 2's
// GPU payload) when blockCompression() says the GPU takes them.
virtual void createTexture(TextureId slot, uint32_t width, uint32_t height, bool srgb, const std::vector<std::vector<uint8_t>>& mips,

View file

@ -157,6 +157,9 @@ public:
void onResize() {
if (backend_) backend_->onResize();
}
void onSurfaceLost() {
if (backend_) backend_->onSurfaceLost();
}
private:
struct Submesh {