+/**
+ * Sames as enumToString, but with special provision to handle formatsLUMINANCE_ALPHA.
+ *
+ * OpenGL 2.1 specification states that "internalFormat may (for backwards
+ * compatibility with the 1.0 version of the GL) also take on the integer
+ * values 1, 2, 3, and 4, which are equivalent to symbolic constants LUMINANCE,
+ * LUMINANCE ALPHA, RGB, and RGBA respectively".
+ */
+const char *
+formatToString(GLenum internalFormat) {
+ switch (internalFormat) {
+ case 1:
+ return "GL_LUMINANCE";
+ case 2:
+ return "GL_LUMINANCE_ALPHA";
+ case 3:
+ return "GL_RGB";
+ case 4:
+ return "GL_RGBA";
+ default:
+ return enumToString(internalFormat);
+ }
+}
+
+