Skip to content

Commit 3b2fbb1

Browse files
Northfearslouken
authored andcommitted
End current scene before destroying the texture on Vita
1 parent e55b850 commit 3b2fbb1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/render/vitagxm/SDL_render_vita_gxm.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,16 @@ VITA_GXM_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture)
12411241
if(vita_texture->tex == 0)
12421242
return;
12431243

1244-
sceGxmFinish(data->gxm_context);
1244+
// make sure that texture isn't used
1245+
if (data->drawing) {
1246+
sceGxmEndScene(data->gxm_context, NULL, NULL);
1247+
data->drawing = SDL_FALSE;
1248+
sceGxmFinish(data->gxm_context);
1249+
StartDrawing(renderer);
1250+
}
1251+
else {
1252+
sceGxmFinish(data->gxm_context);
1253+
}
12451254

12461255
free_gxm_texture(vita_texture->tex);
12471256

0 commit comments

Comments
 (0)