Only mark render-target textures as lost
SDL2 only loses target textures.
This commit is contained in:
parent
05b8b607fa
commit
afed830366
1 changed files with 4 additions and 1 deletions
|
@ -21,6 +21,7 @@ typedef struct RenderBackend_Surface
|
||||||
unsigned char *pixels;
|
unsigned char *pixels;
|
||||||
size_t width;
|
size_t width;
|
||||||
size_t height;
|
size_t height;
|
||||||
|
bool render_target;
|
||||||
bool lost;
|
bool lost;
|
||||||
|
|
||||||
struct RenderBackend_Surface *next;
|
struct RenderBackend_Surface *next;
|
||||||
|
@ -185,6 +186,7 @@ RenderBackend_Surface* RenderBackend_CreateSurface(size_t width, size_t height,
|
||||||
|
|
||||||
surface->width = width;
|
surface->width = width;
|
||||||
surface->height = height;
|
surface->height = height;
|
||||||
|
surface->render_target = render_target;
|
||||||
surface->lost = false;
|
surface->lost = false;
|
||||||
|
|
||||||
// Add to linked-list
|
// Add to linked-list
|
||||||
|
@ -435,6 +437,7 @@ void RenderBackend_DrawGlyph(RenderBackend_GlyphAtlas *atlas, long x, long y, si
|
||||||
void RenderBackend_HandleRenderTargetLoss(void)
|
void RenderBackend_HandleRenderTargetLoss(void)
|
||||||
{
|
{
|
||||||
for (RenderBackend_Surface *surface = surface_list_head; surface != NULL; surface = surface->next)
|
for (RenderBackend_Surface *surface = surface_list_head; surface != NULL; surface = surface->next)
|
||||||
|
if (surface->render_target)
|
||||||
surface->lost = true;
|
surface->lost = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue