Deleting textures in opengl

前端 未结 2 1619
我在风中等你
我在风中等你 2020-12-21 05:48

Do I have to delete all the textures I created (using glDeleteTextures) before the program exists, or does OpenGL delete the textures by himself?

2条回答
  •  粉色の甜心
    2020-12-21 06:11

    OpenGL resources are frees implicitly once all contexts with access to them are destroyed. OpenGL contexts of a process get destroyed when the client terminates; however in the case of indirect GLX context objects may be shared among X11 clients, so they may be freed only after the last client with access to them terminates.

    Nevertheless it's always a good practice to clean up after yourself.

提交回复
热议问题