Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-08-02 02:20:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-02 02:20:45 +0400
commitc92e3225f3aa5fadb9ad0920dffbdc0c0209a98a (patch)
tree6f0c84a36aa52e531d85c47c956d76cb5d0cc599 /source
parent20e6b5280d250c5513f2e533e76542f5160a8845 (diff)
patch [#23144] bpy.Image.gl_load() -- fix
from Dan Eicher (dna) - image.gl_load() was using GL_UNSIGNED_INT rather then GL_UNSIGNED_BYTE channel type. - changed image.gl_load() to use the image clamp settings (patch had this as an extra argument).
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/intern/rna_image_api.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c
index 289530d4f32..efe3d39d6cd 100644
--- a/source/blender/makesrna/intern/rna_image_api.c
+++ b/source/blender/makesrna/intern/rna_image_api.c
@@ -153,10 +153,12 @@ 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_INT, ibuf->rect);
if (!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_INT, ibuf->rect);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ibuf->x, ibuf->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, ibuf->rect);
error = (int)glGetError();
}