Add Renderer::deinitGraphicsContext

This commit is contained in:
wheremyfoodat 2023-10-25 22:46:45 +03:00
parent 1313f46ba4
commit e900e9d614
11 changed files with 31 additions and 1 deletions

View file

@ -801,4 +801,15 @@ void RendererGL::screenshot(const std::string& name) {
}
stbi_write_png(name.c_str(), width, height, 4, flippedPixels.data(), 0);
}
void RendererGL::deinitGraphicsContext() {
// Invalidate all surface caches since they'll no longer be valid
textureCache.reset();
depthBufferCache.reset();
colourBufferCache.reset();
// All other GL objects should be invalidated automatically and be recreated by the next call to initGraphicsContext
// TODO: Make it so that depth and colour buffers get written back to 3DS memory
printf("RendererGL::DeinitGraphicsContext called\n");
}