Mapping a texture from “1D” to “2D” with OpenGL matrix transformations
问题 (With this question I'm trying to investigate an idea I had for solving this other one) If I have a standard 2D array of dimensions width and height in memory, I can turn that into a 1D array of length width * height and then index it via index = x + y * width . This mapping is extremely helpful when allocating and freeing memory for the array as the memory manager does not need to worry about packing the structures in 2D but only needs to worry about the overall length of every allocated