Commit eb5193ef authored by Robert Menzel's avatar Robert Menzel
Browse files

added anisotropic filtering support

parent 950910a7
...@@ -112,6 +112,27 @@ public: ...@@ -112,6 +112,27 @@ public:
openGLRareError(); openGLRareError();
} }
//! _sampleCount = 1.0 to deactivate anisotrop filtering, maximum is often 16. If a value is too high it will get clamped to the maximum
void setAnisotropicFilter( GLfloat _sampleCount )
{
#ifdef ACGL_USE_GLEW
if (GLEW_EXT_texture_filter_anisotropic) {
GLfloat maxAnisotropicSamples;
glGetFloatv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropicSamples );
_sampleCount = std::max( 1.0f, _sampleCount );
_sampleCount = std::min( maxAnisotropicSamples, _sampleCount );
glBindTexture(mTarget, mContext);
glTexParameterf( mTarget, GL_TEXTURE_MAX_ANISOTROPY_EXT, _sampleCount);
openGLRareError();
} else
#endif
{
// anisotropic filtering will just increase the image quality, so this is just
// a warning and no error
ACGL::Utils::warning() << "Anisotropic filtering is not supported, ignored" << std::endl;
}
}
//! Set texture data for 1D, 2D or 3D textures //! Set texture data for 1D, 2D or 3D textures
inline void setImageData(const GLvoid* _pData = NULL) inline void setImageData(const GLvoid* _pData = NULL)
{ {
......
Supports Markdown
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