mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Add function to delete current texture
PR #6662 <https://github.com/Genymobile/scrcpy/pull/6662>
This commit is contained in:
parent
362daa5bad
commit
ac1a8b6ef2
2 changed files with 11 additions and 0 deletions
|
|
@ -225,3 +225,11 @@ sc_texture_set_from_surface(struct sc_texture *tex, SDL_Surface *surface) {
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
sc_texture_reset(struct sc_texture *tex) {
|
||||
if (tex->texture) {
|
||||
SDL_DestroyTexture(tex->texture);
|
||||
tex->texture = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,4 +41,7 @@ sc_texture_set_from_frame(struct sc_texture *tex, const AVFrame *frame);
|
|||
bool
|
||||
sc_texture_set_from_surface(struct sc_texture *tex, SDL_Surface *surface);
|
||||
|
||||
void
|
||||
sc_texture_reset(struct sc_texture *tex);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue