Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ACGL
acgl
Commits
eb5193ef
Commit
eb5193ef
authored
Sep 07, 2011
by
Robert Menzel
Browse files
added anisotropic filtering support
parent
950910a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/ACGL/OpenGL/Objects/Texture.hh
View file @
eb5193ef
...
...
@@ -112,6 +112,27 @@ public:
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.0
f
,
_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
inline
void
setImageData
(
const
GLvoid
*
_pData
=
NULL
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment