From ee1912e4f181594df40203f9c227b89d02a91242 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 15 Mar 2023 01:04:05 +0000 Subject: Add support for setting Texture options on construction --- gfx/models/texture.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'gfx/models/texture.h') diff --git a/gfx/models/texture.h b/gfx/models/texture.h index 1aad1e0..31ffaa5 100644 --- a/gfx/models/texture.h +++ b/gfx/models/texture.h @@ -8,11 +8,17 @@ // IWYU pragma: no_forward_declare Cache class Image; +struct TextureOptions { + GLint wrap {GL_REPEAT}; + GLint minFilter {GL_LINEAR}, magFilter {GL_LINEAR}; +}; + class Texture { public: - explicit Texture(const std::filesystem::path & fileName); - explicit Texture(const Image & image); - explicit Texture(GLsizei width, GLsizei height, const void * data); + explicit Texture(const std::filesystem::path & fileName, TextureOptions = {}); + explicit Texture(const Image & image, TextureOptions = {}); + explicit Texture(GLsizei width, GLsizei height, TextureOptions = {}); + explicit Texture(GLsizei width, GLsizei height, const void * data, TextureOptions = {}); static Cache cachedTexture; -- cgit v1.2.3