Topic/drawable 2 (#1032)

More vertex attribute work
Move drawables above existing layer rendering. 
Use context for the actual draw call.
Fake the vertexes in the shader to get something actually showing up.
Simplify shader state management
This commit is contained in:
Tim Sylvester
2023-04-18 12:31:41 -07:00
committed by Bart Louwers
parent e2bc75289c
commit aceb0394ba
13 changed files with 111 additions and 78 deletions

View File

@@ -47,6 +47,7 @@ public:
virtual void setVertexAttributes(gfx::VertexAttributeArray&&) = 0;
virtual std::vector<std::uint16_t>& getIndexData() const = 0;
virtual std::vector<std::uint8_t>& getVertexData() const = 0;
/// Attach a tweaker to be run on this drawable for each frame
void addTweaker(DrawableTweakerPtr tweaker) { tweakers.emplace_back(std::move(tweaker)); }

View File

@@ -27,7 +27,10 @@ public:
void draw(const PaintParameters &) const override;
void setVertData(std::vector<std::uint8_t> vertexData_, std::vector<uint16_t> indexes_);
void setVertexData(std::vector<std::uint8_t> vertexData, std::vector<uint16_t> indexes,
std::size_t indexOffset, std::size_t indexLength);
std::vector<std::uint16_t>& getIndexData() const override;
std::vector<std::uint8_t>& getVertexData() const override;
const gfx::VertexAttributeArray& getVertexAttributes() const override { return vertexAttributes; }
void setVertexAttributes(const gfx::VertexAttributeArray& value) override {
@@ -38,9 +41,8 @@ public:
}
const gl::VertexArray& getVertexArray() const;
void setVertexArray(gl::VertexArray&&, gfx::UniqueVertexBufferResource&&, gfx::IndexBuffer&&);
std::vector<std::uint16_t>& getIndexData() const override;
void setVertexArray(gl::VertexArray&&, gfx::UniqueVertexBufferResource&&,
gfx::IndexBuffer&&, std::size_t attrOffset);
protected:
class Impl;