[英]OpenGL ES 2.0 - Copy Texture Data
I have an array of 2D textures initialized in OpenGL ES 2.0: 我有一个在OpenGL ES 2.0中初始化的2D纹理数组:
textures[10];
After I delete one of the textures at a given array index: 在删除给定数组索引处的纹理之一后:
glDeleteTextures(1, &textures[5]);
How do I remove the empty gap left in my array, with relative ease, in order to keep things neat and tidy? 如何相对轻松地删除数组中剩余的空白,以使事情保持整洁? Is there a more direct method other than rendering each texture and then using
glGetTexImage
as a way to change the order of the textures in the array? 除了渲染每个纹理然后使用
glGetTexImage
作为更改数组中纹理顺序的方法之外,还有其他更直接的方法吗?
The textures array is actually an array of 'names' represented by non-zero integers set by glGenTextures
that represent texture locations on the GPU. Textures数组实际上是由
glGenTextures
设置的非零整数表示的“名称”数组,该整数表示GPU上的纹理位置。 As long as you keep track of the valid textures names and what your using them for you can sort the array any way you want. 只要您跟踪有效的纹理名称以及将其用作什么,就可以根据需要对数组进行排序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.