47 void setTexture(std::size_t index,
fge::Texture texture);
50 std::size_t getTextureCount()
const;
55 void resize(std::size_t size);
56 void setTextureRect(std::size_t index,
fge::RectInt const& rectangle);
57 void setColor(std::size_t index,
fge::Color const& color);
58 void setSpriteTexture(std::size_t spriteIndex, uint32_t textureIndex);
59 [[nodiscard]] std::size_t getSpriteCount()
const;
61 [[nodiscard]] std::optional<fge::RectInt> getTextureRect(std::size_t index)
const;
62 [[nodiscard]] std::optional<fge::Color> getColor(std::size_t index)
const;
78 [[nodiscard]] std::optional<fge::RectFloat> getGlobalBounds(std::size_t index)
const;
80 [[nodiscard]] std::optional<fge::RectFloat> getLocalBounds(std::size_t index)
const;
83 void updatePositions(std::size_t index);
84 void updateTexCoords(std::size_t index);
85 void updateBuffers()
const;
86 void updateTextures(
bool sizeHasChanged);
90 InstanceData() =
default;
91 explicit InstanceData(
fge::RectInt const& textureRect, glm::uint textureIndex) :
92 _textureRect(textureRect),
93 _textureIndex(textureIndex)
98 glm::uint _textureIndex{0};
100 struct InstanceDataBuffer
102 alignas(16) glm::mat4 _transform;
103 alignas(16) glm::uint _textureIndex{0};
106 std::vector<fge::Texture> g_textures;
108 std::vector<InstanceData> g_instancesData;
114 mutable bool g_needBuffersUpdate;
115 bool const g_featureMultiDrawIndirect;
This class is a wrapper for the texture manager to allow easy manipulation.
Definition C_texture.hpp:36