diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2012-05-28 21:47:42 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2012-05-28 21:47:42 +0400 |
commit | 481658867ec53b3f5dc82d183410d3d35982bad4 (patch) | |
tree | 9d792557e008ec32d3059db6fc4531c162a1da4d /source/blender/makesrna/intern/rna_image_api.c | |
parent | 6323b32c082997a8fe7c1b8cf99106428a4aa9e0 (diff) |
image.gl_load: moving error cleaning to before all gl calls"
Diffstat (limited to 'source/blender/makesrna/intern/rna_image_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_image_api.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 336f033eae4..124a7a7e2b1 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -207,15 +207,16 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int filter, int 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) { |