shithub: cstory

Download patch

ref: afed830366823fa3139945362fb5d19c0ea97ff9
parent: 05b8b607fac266c423febb56ed5ab34b69e7a614
author: Clownacy <Clownacy@users.noreply.github.com>
date: Mon Sep 14 08:24:30 EDT 2020

Only mark render-target textures as lost

SDL2 only loses target textures.

--- a/src/Backends/Rendering/SDLTexture.cpp
+++ b/src/Backends/Rendering/SDLTexture.cpp
@@ -21,6 +21,7 @@
 	unsigned char *pixels;
 	size_t width;
 	size_t height;
+	bool render_target;
 	bool lost;
 
 	struct RenderBackend_Surface *next;
@@ -185,6 +186,7 @@
 
 	surface->width = width;
 	surface->height = height;
+	surface->render_target = render_target;
 	surface->lost = false;
 
 	// Add to linked-list
@@ -435,7 +437,8 @@
 void RenderBackend_HandleRenderTargetLoss(void)
 {
 	for (RenderBackend_Surface *surface = surface_list_head; surface != NULL; surface = surface->next)
-		surface->lost = true;
+		if (surface->render_target)
+			surface->lost = true;
 }
 
 void RenderBackend_HandleWindowResize(size_t width, size_t height)