Commit eb6656fd authored by Janis Born's avatar Janis Born

add setters and getters for texture base/max level to TextureBase

parent 2c6a0f1f
......@@ -110,6 +110,8 @@ public:
inline GLenum getInternalFormat (void) const { return mInternalFormat; }
inline GLint getMinFilter (void) const { return getParameterI(GL_TEXTURE_MIN_FILTER); }
inline GLint getMagFilter (void) const { return getParameterI(GL_TEXTURE_MAG_FILTER); }
inline GLint getBaseLevel (void) const { return getParameterI(GL_TEXTURE_BASE_LEVEL); }
inline GLint getMaxLevel (void) const { return getParameterI(GL_TEXTURE_MAX_LEVEL); }
inline GLint getMinLOD (void) const { return getParameterI(GL_TEXTURE_MIN_LOD); }
inline GLint getMaxLOD (void) const { return getParameterI(GL_TEXTURE_MAX_LOD); }
inline GLfloat getLODBias (void) const { return getParameterF(GL_TEXTURE_LOD_BIAS); }
......@@ -156,6 +158,12 @@ public:
void setWrap(GLenum _wrapS, GLenum _wrapT = 0, GLenum _wrapR = 0);
#endif
//! lowest defined mipmap level
void setBaseLevel( GLint _level = -1000 );
//! highest defined mipmap level
void setMaxLevel( GLint _level = 1000 );
//! lowest mipmap level to use
void setMinLOD( GLint _lod = -1000 );
......
......@@ -62,6 +62,20 @@ void TextureBase::setWrap( GLenum _wrapS, GLenum _wrapT, GLenum _wrapR )
}
#endif // ACGL_OPENGLES_VERSION_20
void TextureBase::setBaseLevel( GLint _level )
{
GLuint prevTexture = bindAndGetOldTexture();
glTexParameteri( mTarget, GL_TEXTURE_BASE_LEVEL, _level);
glBindTexture(mTarget, prevTexture);
}
void TextureBase::setMaxLevel( GLint _level )
{
GLuint prevTexture = bindAndGetOldTexture();
glTexParameteri( mTarget, GL_TEXTURE_MAX_LEVEL, _level);
glBindTexture(mTarget, prevTexture);
}
void TextureBase::setMinLOD( GLint _lod )
{
GLuint prevTexture = bindAndGetOldTexture();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment