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
eb6656fd
Commit
eb6656fd
authored
Jun 06, 2013
by
Janis Born
Browse files
add setters and getters for texture base/max level to TextureBase
parent
2c6a0f1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/ACGL/OpenGL/Objects/Texture.hh
View file @
eb6656fd
...
...
@@ -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
);
...
...
src/ACGL/OpenGL/Objects/Texture.cc
View file @
eb6656fd
...
...
@@ -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
();
...
...
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