diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-01-14 15:51:01 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-01-14 15:51:01 +0300 |
commit | d4f4bf85bee2d9efb60e2e343d5415d09b3b1aa1 (patch) | |
tree | ab94703c2fb882e7af898f8735b894ca6e9aa611 /source/blender/src/glutil.c | |
parent | b7ccb830d23156100749e27f35f1ee210d474d3b (diff) |
Bugfix: after drawing a preview in a node shader, vertex colors would
not modulate the texture color in textured draw mode anymore. Cause was
the relevant opengl state not being changed back for drawing the mesh.
Diffstat (limited to 'source/blender/src/glutil.c')
-rw-r--r-- | source/blender/src/glutil.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/src/glutil.c b/source/blender/src/glutil.c index fde0601e3ee..9a4a67c7f35 100644 --- a/source/blender/src/glutil.c +++ b/source/blender/src/glutil.c @@ -238,7 +238,6 @@ static int get_cached_work_texture(int *w_r, int *h_r) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); tbuf= MEM_callocN(tex_w*tex_h*4, "tbuf"); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, tex_w, tex_h, 0, GL_RGBA, GL_UNSIGNED_BYTE, tbuf); @@ -264,6 +263,7 @@ void glaDrawPixelsTex(float x, float y, int img_w, int img_h, int format, void * int nsubparts_x= (img_w+(tex_w-1))/tex_w; int nsubparts_y= (img_h+(tex_h-1))/tex_h; + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glPixelStorei(GL_UNPACK_ROW_LENGTH, img_w); glBindTexture(GL_TEXTURE_2D, texid); @@ -300,6 +300,7 @@ void glaDrawPixelsTex(float x, float y, int img_w, int img_h, int format, void * glBindTexture(GL_TEXTURE_2D, ltexid); glPixelStorei(GL_UNPACK_ROW_LENGTH, lrowlength); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); } #define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val)) |