diff options
author | rtk0c <[email protected]> | 2022-11-25 17:28:07 -0800 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-11-25 17:28:07 -0800 |
commit | f3269a49c474ffe4d382c3d60826ad1cfbb7cdc4 (patch) | |
tree | bf7854505e9dae60c84e64764589c240339c3a41 /source/30-game/Texture.hpp | |
parent | a0ddfdbcbc6336685362343518770f7bdefd10fe (diff) |
Changeset: 93 Branch comment: [] Port font and UTF-8 string utilities from p6503master-ui-framework
Diffstat (limited to 'source/30-game/Texture.hpp')
-rw-r--r-- | source/30-game/Texture.hpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source/30-game/Texture.hpp b/source/30-game/Texture.hpp index 108dfa7..2931724 100644 --- a/source/30-game/Texture.hpp +++ b/source/30-game/Texture.hpp @@ -19,17 +19,19 @@ struct Subregion { float v1 = 0.0f; }; -struct TextureInfo { - glm::ivec2 size; - Tags::TexFilter minifyingFilter = Tags::TF_Linear; - Tags::TexFilter magnifyingFilter = Tags::TF_Linear; +struct TextureProperties { + // All [In] fields should be set by the user before initializing the texture + // All [Out] fields will be set by the initialization process, and any previously user-set value will be ignored + /* [In] */ Tags::TexFilter minifyingFilter = Tags::TF_Linear; + /* [In] */ Tags::TexFilter magnifyingFilter = Tags::TF_Linear; + /* [Out] */ glm::ivec2 size; }; class Texture : public RefCounted { friend class TextureStitcher; private: - TextureInfo mInfo; + TextureProperties mProps; GLuint mHandle = 0; public: @@ -47,9 +49,8 @@ public: EC_FileIoFailed, EC_InvalidImage, }; - - ErrorCode InitFromFile(const char* filePath); - ErrorCode InitFromImage(const Image& image); + ErrorCode InitFromFile(const char* filePath, const TextureProperties& props = {}); + ErrorCode InitFromImage(const Image& image, const TextureProperties& props = {}); struct AtlasSource { std::string name; @@ -77,7 +78,7 @@ public: }; ErrorCode InitAtlas(const AtlasInput& in, AtlasOutput* out = nullptr); - const TextureInfo& GetInfo() const; + const TextureProperties& GetInfo() const; GLuint GetHandle() const; bool IsValid() const; |