Basically, I had this awful felling in my texture loading code: It’s so complicated, so full of cases, let’s makes everything easier and “bug proof” (lol).
I didn’t used to use so much glTexImage3D but now with texture array or texture 3d used like texture array, it becomes quite useful.
And I felt: “Why using glTexImage1D and glTexImage2D when glTexImage3D and glCompressedTexImage3D could do the job in any case?!” With few wrapping around in the code it could be like just a single function to load any texture …
The warpper:
void TexImage(
GLenum target,
GLint level,
GLint internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLsizei texelSize, //Basically, used from compressed data size
const GLvoid * data);
Any reason not to do that? Is glTexImage2D and glTexImage1D would provide significant better performance for texture uploading? I don’t any specific reason but maybe…