Perform OpenGL texture cleanup only on main thread.

This commit is contained in:
Bartosz Taudul
2020-08-15 15:02:36 +02:00
parent a3d8b5d225
commit 28af5230d3
3 changed files with 7 additions and 5 deletions

View File

@@ -21,10 +21,10 @@ void* MakeTexture()
return (void*)(intptr_t)tex;
}
void FreeTexture( void* _tex )
void FreeTexture( void* _tex, void(*runOnMainThread)(std::function<void()>) )
{
auto tex = (GLuint)(intptr_t)_tex;
glDeleteTextures( 1, &tex );
runOnMainThread( [tex] { glDeleteTextures( 1, &tex ); } );
}
void UpdateTexture( void* _tex, const char* data, int w, int h )