void check_gl_error() { int error = glGetError(); if (error != GL_NO_ERROR) fprintf(stderr, "%s\n", gluErrorString(error)); } GLuint g; glGenTextures(1,&g); glBindTexture(GL_TEXTURE_2D,g); check_gl_error(); /* No output, and no I'm not redirecting stderr either */