* Releases texture data memory using the same method it was allocated */
| 61 | * Releases texture data memory using the same method it was allocated |
| 62 | */ |
| 63 | void UnloadTextureData(TextureData& textureData) { |
| 64 | |
| 65 | if (textureData.texels) { |
| 66 | if (textureData.stbAllocation) |
| 67 | stbi_image_free(textureData.texels); |
| 68 | else |
| 69 | delete[] textureData.texels; |
| 70 | } |
| 71 | |
| 72 | textureData.texels = nullptr; |
| 73 | textureData.stbAllocation = false; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Compute the aligned memory required for the texture. |
no test coverage detected