Well, the title says it all...
glGenTextures(1, &textureid);
Assuming that the texture was created succesfully, could textureid be 0?
Well, the title says it all...
glGenTextures(1, &textureid);
Assuming that the texture was created succesfully, could textureid be 0?
The manual page for glGenTextures says see also glIsTexture; the latter will (according to that) always return GL_FALSE
for a texture name of 0. So, 0 can't be a valid texture name.
From the OpenGL Spec 3.1: on page 157:
If a texture object is deleted, it as if all texture units which are bound to that texture object are rebound to texture object zero.
It seems to me that the zero named texture is a special one
The correct way to do error checking in OpenGL is generally to call glGetError. You can then check for both of the error conditions listed in the description of glGenTextures. As also mentioned, you can call glIsTexture to check if a given texture is valid.