diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-15 01:04:05 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-15 01:04:05 +0000 |
commit | ee1912e4f181594df40203f9c227b89d02a91242 (patch) | |
tree | 789ac0d91c9b0a83e90c4bc988209e707724641c /gfx/models/texture.h | |
parent | Support creating a super texture from fragments (diff) | |
download | ilt-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.h | 12 |
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;
|