summaryrefslogtreecommitdiff
path: root/gfx/models/texture.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-03-15 01:04:05 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-03-15 01:04:05 +0000
commitee1912e4f181594df40203f9c227b89d02a91242 (patch)
tree789ac0d91c9b0a83e90c4bc988209e707724641c /gfx/models/texture.h
parentSupport creating a super texture from fragments (diff)
downloadilt-ee1912e4f181594df40203f9c227b89d02a91242.tar.bz2
ilt-ee1912e4f181594df40203f9c227b89d02a91242.tar.xz
ilt-ee1912e4f181594df40203f9c227b89d02a91242.zip
Add support for setting Texture options on construction
Diffstat (limited to 'gfx/models/texture.h')
-rw-r--r--gfx/models/texture.h12
1 files changed, 9 insertions, 3 deletions
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<Texture, std::filesystem::path> cachedTexture;