41 ObjSpriteBatches(ObjSpriteBatches
const& r);
47 void setTexture(std::size_t index,
fge::Texture texture);
50 std::size_t getTextureCount()
const;
54 fge::Transformable& addSprite(fge::RectInt
const& rectangle, uint32_t textureIndex = 0);
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;
69 void save(nlohmann::json& jsonObject)
override;
70 void load(nlohmann::json& jsonObject, std::filesystem::path
const& filePath)
override;
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)
97 fge::RectInt _textureRect;
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;
109 mutable fge::vulkan::UniformBuffer g_instancesTransform;
110 mutable fge::vulkan::UniformBuffer g_instancesIndirectCommands;
111 mutable fge::vulkan::DescriptorSet g_descriptorSets[2];
112 fge::vulkan::VertexBuffer g_instancesVertices;
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