Add widgets (WIP)

This commit is contained in:
Jérôme Leclercq
2021-10-04 09:25:45 +02:00
parent 68708c54f7
commit a66f6faed1
31 changed files with 1955 additions and 24 deletions

View File

@@ -27,17 +27,28 @@ namespace Nz
void BuildElement(std::size_t passIndex, const WorldInstance& worldInstance, std::vector<std::unique_ptr<RenderElement>>& elements) const override;
inline const Color& GetColor() const;
inline const Color& GetCornerColor(RectCorner corner) const;
const std::shared_ptr<Material>& GetMaterial(std::size_t i) const;
std::size_t GetMaterialCount() const;
inline void SetColor(const Color& color);
inline void SetCornerColor(RectCorner corner, const Color& color);
inline void SetMaterial(std::shared_ptr<Material> material);
inline void SetSize(const Vector2f& size);
Sprite& operator=(const Sprite&) = delete;
Sprite& operator=(Sprite&&) noexcept = default;
private:
inline void UpdateVertices();
std::array<Color, RectCornerCount> m_cornerColor;
std::array<VertexStruct_XYZ_Color_UV, 4> m_vertices;
std::shared_ptr<Material> m_material;
Color m_color;
Rectf m_textureCoords;
Vector2f m_size;
};
}