texture creation exception handling

When you create a texture, using (glGenTextures) and glTexImage2D, how do you know if the texture was really created. Is there a way of checking like: if(!(byte = malloc(1))){…}. When memory is low this can happen.

I assume you’d get GL_OUT_OF_MEMORY back from glGetError() when your memory is low…

This way it’s possible not only to check out of memory errors but ALL errors, the rest it’s up to you (wrong pointers, data formats, data size and so on)…

rIO.sK http://www.spinningkids.org/rio