Skip to content

Instantly share code, notes, and snippets.

@kbenzie
Created July 24, 2013 20:28
Show Gist options
  • Save kbenzie/6074229 to your computer and use it in GitHub Desktop.
Save kbenzie/6074229 to your computer and use it in GitHub Desktop.
GLenum type string convenience function
static const char * const glGetTypeString(GLenum type)
{
switch (type)
{
case GL_BYTE : return "GLbyte";
case GL_UNSIGNED_BYTE : return "GLubyte";
case GL_SHORT : return "GLshort";
case GL_UNSIGNED_SHORT : return "GLushort";
case GL_INT : return "GLint";
case GL_UNSIGNED_INT : return "GLuint";
case GL_FLOAT : return "GLfloat";
case GL_2_BYTES : return "GL_2_BYTES";
case GL_3_BYTES : return "GL_3_BYTES";
case GL_4_BYTES : return "GL_4_BYTES";
case GL_DOUBLE : return "GLdouble";
default: return "not a GLenum type";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment