From 169eb0fd07718f29b8678d373e7ffb17265d8828 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 18 Aug 2003 19:51:27 +0000 Subject: [PATCH] Changed applyTextParamaters() to set the wrap modes : GL_TEXTURE_WRAP_S for all texture targets. GL_TEXTURE_WRAP_T for all texture targets except GL_TEXRTURE_1D GL_TEXTURE_WRAP_R for only GL_TEXTURE_3D And changed the defaults to OpenGL defaults of GL_REPEAT. --- src/osg/Texture.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index 00c2cc01d..46a9ddd4c 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -164,9 +164,9 @@ void Texture::flushTextureObjects(unsigned int contextID,double currentTime, dou } Texture::Texture(): - _wrap_s(CLAMP), - _wrap_t(CLAMP), - _wrap_r(CLAMP), + _wrap_s(REPEAT), + _wrap_t(REPEAT), + _wrap_r(REPEAT), _min_filter(LINEAR_MIPMAP_LINEAR), // trilinear _mag_filter(LINEAR), _maxAnisotropy(1.0f), @@ -454,8 +454,10 @@ void Texture::applyTexParameters(GLenum target, State& state) const } glTexParameteri( target, GL_TEXTURE_WRAP_S, ws ); - glTexParameteri( target, GL_TEXTURE_WRAP_T, wt ); - glTexParameteri( target, GL_TEXTURE_WRAP_R, wr ); + + if (target!=GL_TEXTURE_1D) glTexParameteri( target, GL_TEXTURE_WRAP_T, wt ); + + if (target==GL_TEXTURE_3D) glTexParameteri( target, GL_TEXTURE_WRAP_R, wr ); glTexParameteri( target, GL_TEXTURE_MIN_FILTER, _min_filter); glTexParameteri( target, GL_TEXTURE_MAG_FILTER, _mag_filter);