]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
moved CHECKGLERROR to detect errors *after* rather than before uploading a texture
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 22 Jan 2002 07:01:30 +0000 (07:01 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 22 Jan 2002 07:01:30 +0000 (07:01 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@1386 d7cf8633-e32d-0410-b094-e92efae38249

gl_textures.c

index f62a0cb0f729319ddc995e8dddcd0626af60cae2..ef719e4c03688106cbc674867bdfa0646da1eb0a 100644 (file)
@@ -1006,12 +1006,12 @@ static void R_Upload(gltexture_t *glt, byte *data)
                {
                        glt->image->flags &= ~GLTEXF_UPLOAD;
                        memset(resizebuffer, 255, glt->image->width * glt->image->height * glt->image->bytesperpixel);
+                       glTexImage2D (GL_TEXTURE_2D, 0, glt->image->glinternalformat, glt->image->width, glt->image->height, 0, glt->image->glformat, GL_UNSIGNED_BYTE, resizebuffer);
+                       CHECKGLERROR
                        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_mag);
                        CHECKGLERROR
                        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_mag);
                        CHECKGLERROR
-                       glTexImage2D (GL_TEXTURE_2D, 0, glt->image->glinternalformat, glt->image->width, glt->image->height, 0, glt->image->glformat, GL_UNSIGNED_BYTE, resizebuffer);
-                       CHECKGLERROR
                }
 
                if (prevbuffer == NULL)