开发者

When to call glDeleteBuffers()

开发者 https://www.devze.com 2023-03-12 16:38 出处:网络
Currently, I have a native function set up that I\'m calling during onDestroy() on the Java side. I\'m calling free() on any native side pointers I have memory allocated for. If I also call glDeleteBu

Currently, I have a native function set up that I'm calling during onDestroy() on the Java side. I'm calling free() on any native side pointers I have memory allocated for. If I also call glDeleteBuffers() in this function, I get a an error in logcat stating

call to OpenGL ES API with no current context (logged onc开发者_开发百科e per thread)

I gather I could interrupt the Back Button Press and handle things more gracefully, but in the case the app is killed another way, what is the best way to make sure I've freed the gl resources in a timely manner?


When the context is destroyed it frees all it's resources (textures, buffers etc.) so it is not necessary to delete them manually.

0

精彩评论

暂无评论...
验证码 换一张
取 消