|
|
|
|
@ -22,7 +22,7 @@ Texture::~Texture()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Texture::Create(u32 width, u32 height, GLenum internal_format, GLenum format, GLenum type, const void* data,
|
|
|
|
|
bool linear_filter)
|
|
|
|
|
bool linear_filter, bool wrap)
|
|
|
|
|
{
|
|
|
|
|
glGetError();
|
|
|
|
|
|
|
|
|
|
@ -32,6 +32,8 @@ bool Texture::Create(u32 width, u32 height, GLenum internal_format, GLenum forma
|
|
|
|
|
glTexImage2D(GL_TEXTURE_2D, 0, internal_format, width, height, 0, format, type, data);
|
|
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, linear_filter ? GL_LINEAR : GL_NEAREST);
|
|
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, linear_filter ? GL_LINEAR : GL_NEAREST);
|
|
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap ? GL_REPEAT : GL_CLAMP_TO_EDGE);
|
|
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap ? GL_REPEAT : GL_CLAMP_TO_EDGE);
|
|
|
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 1);
|
|
|
|
|
|
|
|
|
|
GLenum error = glGetError();
|
|
|
|
|
|