- Reset the SDL texture to avoid the renderer hanging.
This commit is contained in:
committed by
David Hrdlička
parent
2d6cc7576b
commit
69c8af4a2e
@@ -58,6 +58,7 @@ extern int sdl_inith_fs(HWND h);
|
|||||||
extern int sdl_pause(void);
|
extern int sdl_pause(void);
|
||||||
extern void sdl_resize(int x, int y);
|
extern void sdl_resize(int x, int y);
|
||||||
extern void sdl_enable(int enable);
|
extern void sdl_enable(int enable);
|
||||||
|
extern void sdl_reinit_texture();
|
||||||
|
|
||||||
|
|
||||||
#endif /*WIN_SDL_H*/
|
#endif /*WIN_SDL_H*/
|
||||||
|
@@ -181,6 +181,8 @@ sdl_stretch(int *w, int *h, int *x, int *y)
|
|||||||
*y = (int) dy;
|
*y = (int) dy;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sdl_reinit_texture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -489,6 +491,18 @@ sdl_inith_fs(HWND h)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
sdl_reinit_texture()
|
||||||
|
{
|
||||||
|
if (sdl_render == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
SDL_DestroyTexture(sdl_tex);
|
||||||
|
sdl_tex = SDL_CreateTexture(sdl_render, SDL_PIXELFORMAT_ARGB8888,
|
||||||
|
SDL_TEXTUREACCESS_STREAMING, 2048, 2048);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
sdl_pause(void)
|
sdl_pause(void)
|
||||||
{
|
{
|
||||||
@@ -514,6 +528,8 @@ sdl_resize(int x, int y)
|
|||||||
|
|
||||||
cur_w = x;
|
cur_w = x;
|
||||||
cur_h = y;
|
cur_h = y;
|
||||||
|
|
||||||
|
sdl_reinit_texture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user