Add texture_2d wrap options
This commit is contained in:
parent
2dd9ebae76
commit
e53d5fba13
2 changed files with 17 additions and 0 deletions
|
|
@ -107,6 +107,9 @@ namespace psemek::gfx
|
|||
void linear_filter();
|
||||
void anisotropy();
|
||||
|
||||
void repeat();
|
||||
void clamp();
|
||||
|
||||
private:
|
||||
GLuint id_;
|
||||
int width_ = 0;
|
||||
|
|
|
|||
|
|
@ -108,4 +108,18 @@ namespace psemek::gfx
|
|||
gl::TexParameterf(gl::TEXTURE_2D, gl::TEXTURE_MAX_ANISOTROPY_EXT, *level);
|
||||
}
|
||||
|
||||
void texture_2d::repeat()
|
||||
{
|
||||
bind();
|
||||
gl::TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_WRAP_S, gl::REPEAT);
|
||||
gl::TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_WRAP_T, gl::REPEAT);
|
||||
}
|
||||
|
||||
void texture_2d::clamp()
|
||||
{
|
||||
bind();
|
||||
gl::TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_WRAP_S, gl::CLAMP_TO_EDGE);
|
||||
gl::TexParameteri(gl::TEXTURE_2D, gl::TEXTURE_WRAP_T, gl::CLAMP_TO_EDGE);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue