[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47129] trunk/blender/source/blender/ makesrna/intern/rna_image_api.c: image.gl_load: moving error cleaning to before all gl calls"

Dalai Felinto dfelinto at gmail.com
Mon May 28 19:47:42 CEST 2012


Revision: 47129
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47129
Author:   dfelinto
Date:     2012-05-28 17:47:42 +0000 (Mon, 28 May 2012)
Log Message:
-----------
image.gl_load: moving error cleaning to before all gl calls"

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_image_api.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_image_api.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_image_api.c	2012-05-28 17:35:55 UTC (rev 47128)
+++ trunk/blender/source/blender/makesrna/intern/rna_image_api.c	2012-05-28 17:47:42 UTC (rev 47129)
@@ -207,15 +207,16 @@
 		error = (int)gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, ibuf->x, ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
 
 	if (!error) {
+		/* clean glError buffer */
+		while (glGetError() != GL_NO_ERROR){};
+
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, image->tpageflag & IMA_CLAMP_U ? GL_CLAMP : GL_REPEAT);
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, image->tpageflag & IMA_CLAMP_V ? GL_CLAMP : GL_REPEAT);
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (GLint)filter);
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (GLint)mag);
 		glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
 		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ibuf->x, ibuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
-
-		while (error != GL_NO_ERROR)
-			error = (int)glGetError();
+		error = (int)glGetError();
 	}
 
 	if (error) {




More information about the Bf-blender-cvs mailing list