From 6323b32c082997a8fe7c1b8cf99106428a4aa9e0 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 28 May 2012 17:03:13 +0000 Subject: [PATCH] image.gl_load(): clear glGetError buffer before getting a new one --- source/blender/makesrna/intern/rna_image_api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index cf19002f44e..336f033eae4 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -213,7 +213,9 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int filter, int 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); - error = (int)glGetError(); + + while (error != GL_NO_ERROR) + error = (int)glGetError(); } if (error) {