According to the OpenGL docs, glGenTextures indicates failure not through
returning a value in its out parameter but rather via the glGetError API.
Moreover it could not actually indicate failure in the way this call site was
expecting because the out parameter is unsigned, not signed. This issue was
identified while investigating the cause of the following compiler warning:
glcomptexture.c: In function ‘glCompSetAddNewTexture’:
glcomptexture.c:45:12: warning: comparison of unsigned expression < 0 is
always false [-Wtype-limits]
if (t->id < 0) /*for some opengl based error , texture couldnt be created */
^
- "Warning! PATH too long installer unable to modify PATH!" using CMake Windows installer and PATH length > 1024 #1770
- gvedit -? gives "option - unrecognized - ignored" instead of showing usage #1813
- lefty is not built for Windows (fixed for MSBuild builds only) #1818
+- a failure to detect OpenGL glGenTextures() errors has been corrected
## [2.44.1] - 2020-06-29
glEnable(GL_DEPTH_TEST);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glGenTextures(1, &t->id); //get next id
- if (t->id < 0) /*for some opengl based error , texture couldnt be created */
+ if (glGetError() != GL_NO_ERROR) { /*for some opengl based error , texture couldnt be created */
+ /* drain the OpenGL error queue */
+ while (glGetError() != GL_NO_ERROR);
Er = 1;
- else {
+ } else {
glBindTexture(GL_TEXTURE_2D, t->id);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);